*nix equivalents to Windows VMem functions.

Started by
1 comment, last by Krylloan 20 years, 8 months ago
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?
Advertisement
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.
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.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement