CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002
    Posts
    7

    Memory Management functions

    Hi Friends,

    I need the equivalent windows function that implements sbrk in Linux
    Also
    I need the equivalent windows function that implements mmap in Linux

    Can you please help me out?

    Thanks,

    Sarma

  2. #2
    Join Date
    May 2002
    Location
    India
    Posts
    4
    Pls explain about sbrk,mmap functionalities

  3. #3
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,020
    sbrk: process memory allocation/deallocation is low level kernel stuff. I don't know of any equivalent of sbrk. Step into "new" in the debugger and see where it takes you. That's probably the nearest you will get to sbrk. Anyway, all processes have a virtual space of 4Gb.

    mmap: Memory mapping files in windows is quite painful to use: you need to lock to access the mapped memory and unlock so that everyone else can see it. The routines you need to look at are

    CreateFileMapping - for the server
    OpenFileMapping - for the client
    MapViewOfFile - whenever you wish to access it
    UnmapViewOfFile - whenever you have finished accessing it.
    Succinct is verbose for terse

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured