On Sat, Jun 7, 2008 at 2:19 PM, Quincey Morris <[EMAIL PROTECTED]> wrote: > The consequence of this should be either: > > (a) [data bytes] must promise to return a collectable object (so that the > 'bytes' reference keeps it alive), or > > (b) [data bytes] must lock (pseudo-retain) something internally (possibly > just 'data' itself) and be matched with an unlock (pseudo-release) method. > > (Maybe there's a 3rd option, but I can't think of it. Your custom allocator > suggestion is more or less equivalent to (b), I think.)
The custom allocator idea would actually be a way of implementing option (a). I assume the reason (a) isn't used now, aside from simple legacy or not having thought about it, is because sometimes NSData wraps pointers which *can't* be collected, because they need to be "freed" using calls such as munmap and the current collector only works with pointers that it allocates itself. Adding support for custom allocators to the collector would allow such special cases to work. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]