Click to See Complete Forum and Search --> : Memory Management functions


eHunter
May 30th, 2002, 05:46 AM
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

pm_sarjoon
May 31st, 2002, 01:27 AM
Pls explain about sbrk,mmap functionalities

cup
June 25th, 2002, 12:49 PM
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.