Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 64 bit addressing again



Hi Jim,

It is possible that the slower performance with mmap() was caused by something else - maybe the cost of creating and deleting the files? It wasn't a huge hit, but the vm_allocate() approach did offer slightly better speed.

Would this be something that Apple could look at implementing as an official API? It would form a stop-gap until we have full 64 bit addressing for user mode applications (a bit like AWE on Windows).

Cheers,

Steve.

On 11 Feb 2004, at 17:54, Jim Magee wrote:

On Feb 11, 2004, at 11:58 AM, Steve Baxter wrote:
I got this working after a lot of help from this list a couple of months back. If you search the archives for my posts you should see how!

Basically, you need to have a scheme that manages your large blocks of memory. I used C++ objects to do this.

You can use vm_allocate() to allocate blocks. You need to get a memory entry to each allocated block as well using mach_make_memory_entry().
...<snip>...
- I tried mmap() but it was more fiddly. The advantage of this scheme is that you don't have to allocate any files - the default pager will do all this for you. I also found that mmap() was significantly slower than this scheme, probable because it was trying to keep data on the disk up to date even though it doesn't have to.

Hmmm. If one never calls msync(), we should be no more interested in keeping mmap()'ed files in sync with the disk than we are anonymous (vm_allocate()ed) memory. Do you have a code snippet (I remember your previous posts - but I don't remember ever reproducing your results in this area).

Thanks,
--Jim

- vm_*() are private functions and could go away in a future version of Mac OS, though this is very unlikely.

And thanks for posting that caveat. ;-)


--
Steve Baxter
Software Development Manager
Improvision
+44-2476-692229
email@hidden
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >64 bit addressing again (From: Andreas Lachner <email@hidden>)
 >Re: 64 bit addressing again (From: Josh de Cesare <email@hidden>)
 >Re: 64 bit addressing again (From: Steve Baxter <email@hidden>)
 >Re: 64 bit addressing again (From: Jim Magee <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.