*nix equivalents to Windows VMem functions.
I''m trying to port a version of my generic allocator to *nix. The specific W32 functions I''m using are.
VirtualAlloc()
VirtualFree()
VirtualQuery()
Does anyone know of equivalent linux functions?
Basically, all I want to do is:
get page size (I know this one).
reserve/release specific pages.
commit/decommit specific pages with read/write access.
get page status.
All I can find in "unistd.h" is mmap, which requires a file as backing, and brk, which only allocates consecutively. Does *nix even support general-case VMem management?
Ok, it seems I was wrong about mmap(). It doesn''t require a file descriptor.
However, I still need to know how to (and it it''s possible to):
Reserve pages in *nix without actually allocating them. (Like VirtualAlloc(#,#,MEM_RESERVE,#). The method needs to be threadsafe.
Check whether pages are in use or reserved.
However, I still need to know how to (and it it''s possible to):
Reserve pages in *nix without actually allocating them. (Like VirtualAlloc(#,#,MEM_RESERVE,#). The method needs to be threadsafe.
Check whether pages are in use or reserved.
Perhaps as a vendor extention. Please let me know if you dig up anything, and you might consider asking such a question in the ''Everything Unix'' forum.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement