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: Why does free() take 1,100 microseconds?



neal olander wrote:


What could free() be doing that could possibly take 1,100 microseconds, and is there any thing I can do to reduce that time?

Perhaps it's paging?

Try not to free it but reuse the same buffer instead. Allocate it not with malloc, but with vm_allocate,
then vm_wire it. This avoids paging and bypasses the global malloc lock. It also gives you a nice
page-aligned buffer that you can then slice and dice any way you want (e.g. for cache coloring).


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Why does free() take 1,100 microseconds? (From: "neal olander" <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.