Re: Encapsulate C struct/toll-free bridging?
Re: Encapsulate C struct/toll-free bridging?
- Subject: Re: Encapsulate C struct/toll-free bridging?
- From: Allan Odgaard <email@hidden>
- Date: Wed, 10 Mar 2004 03:40:33 +0100
On 10. Mar 2004, at 1:32, Allan Odgaard wrote:
But another problem is the reference counting [...]
I looked a little deeper into this, Foundation documentation speaks of
the count of any extra reference, where the OpenStep documentation
adds "externally maintained", and also says that: "The first reference
[...] isn't maintained externally", where Foundation only says: "Extra
references are those beyond the single original reference".
I do not know if there is any statement about wether or not Cocoa must,
at all times, comply to the OpenStep specifications, if there is, then
I would say it's safe to use any (unique memory) pointer with the
reference count functions, and so the OP should not be concerned about
going through the NSAllocateObject function I proposed.
For the records, Foundation currently do conform to the OpenStep
specification with regard to the above reference counting functions,
but I know there is an experimental garbage-collection switch for GCC
which could change the behavior (did not look into that) -- perhaps the
description of the functions were made more shallow to prepare for any
potential change in the reference count system.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.