Archived

This topic is now archived and is closed to further replies.

*nix equivalents to Windows VMem functions.

This topic is 5237 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites