Re: [[object autorelease] release]
Re: [[object autorelease] release]
- Subject: Re: [[object autorelease] release]
- From: Rosyna <email@hidden>
- Date: Tue, 2 Oct 2001 05:07:44 -0700
Its a huge speed hit to see if the object in the autorelease pool has
been released already? I know there is a function called
From NSDebug.h
FOUNDATION_EXPORT BOOL NSIsFreedObject(id anObject);
and more from there.
+ (void)enableFreedObjectCheck:(BOOL)enable;
// Enables or disables freed-object checking for the pool stack
// of the current thread (and any future pools in that thread).
// When enabled, an autorelease pool will call the function
// _NSAutoreleaseFreedObject() when it is about to attempt to
// release an object that the runtime has marked as freed (and
// then it doesn't attempt to send -release to the freed storage).
// The pointer to the freed storage is passed to that function.
// The "default default" value can be set in the initial
// environment when a program is launched with the
// NSAutoreleaseFreedObjectCheckEnabled environment variable
// (see notes at the top of this file) -- as thread pool-stacks
// are created, they take their initial freed-object-check state
// from that environment variable.
Ack, at 10/1/01, Ondra Cada said:
would have to be something like "releaseAutoreleased" lest the generic
release implementation is too slow (since it would have to check all the
pools).
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insane People