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: custom memory allocations




On Sep 30, 2005, at 12:53 PM, Ladd Van Tol wrote:
So I'm curious -- how is the retain count handled? I know that it's stored externally, but is it implicitly 1 on a new allocation?

Yes. The core functions for this are for 'extra ref counts' (NSDecrementExtraRefCountWasZero, in particular). You can, of course, put your ref count (or low order bits) inline in your object to save on memory in the external table (and more expensive implementation). Standard caveats about threading and locking apply :)


-tim

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

This email sent to email@hidden
References: 
 >custom memory allocations (From: Niko Matsakis <email@hidden>)
 >Re: custom memory allocations (From: Greg Parker <email@hidden>)
 >Re: custom memory allocations (From: Ladd Van Tol <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.