NSAutoreleasePool $Revision$ $Date$ NSAutoreleasePool Foundation/NSAutoreleasePool.h NSObject

This class maintains a stack of autorelease pools objects in each thread.

When an autorelease pool is created, it is automatically added to the stack of pools in the thread.

When a pool is destroyed, it (and any pool later in the stack) is removed from the stack.

addObject: anObject

Adds the specified object to the current autorelease pool. If there is no autorelease pool in the thread, a warning is logged.

addObject: anObject

Adds the specified object to this autorelease pool.

enableRelease: flag

Specifies whether objects contained in autorelease pools are to be released when the pools are deallocated (by default YES).

You can set this to NO for debugging purposes.

autoreleaseCountForObject: anObject

Counts the number of times that the specified object occurs in autorelease pools in the current thread.

This method is slow and should probably only be used for debugging purposes.

freeCache

When autorelease pools are deallocated, the memory they used is retained in a cache for re-use so that new polls can be created very quickly.

This method may be used to empty that cache, ensuring that the minimum memory is used by the application.

setPoolCountThreshold: c

Specifies a limit to the number of objects that may be added to an autorelease pool. When this limit is reached an exception is raised.

You can set this to a smallish value to catch problems with code that autoreleases too many objects to operate efficiently.

Default value is maxint.