Archived

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

Krylloan

*nix equivalents to Windows VMem functions.

Recommended Posts

Krylloan    142
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
Krylloan    142
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