Jump to content
  • Advertisement

Archived

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

Krylloan

*nix equivalents to Windows VMem functions.

This topic is 5453 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
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.

Share this post


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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!