Manages temporary objects in mulle-objc. Provides automatic memory management through autorelease pools.
None (Root Class)
NSAutoreleasePool *_owner; // Parent pool
void *_storage; // Object storage
char _mulleNameUTF8String[48]; // Pool name
+alloc
- Creates new pool+new
- Creates and initializes pool-init
- Initializes pool-drain
- Releases pool and contained objects-release
- Releases pool-mulleReleaseAllPoolObjects
- Releases all objects but keeps pool+addObject:
- Adds object to current pool-addObject:
- Adds object to this pool+mulleAddObjects:count:
- Adds multiple objects-mulleAddObjects:count:
- Adds multiple objects to this pool+mulleDefaultAutoreleasePool
- Gets current thread’s top pool+mulleParentAutoreleasePool
- Gets parent of current pool-mulleParentAutoreleasePool
- Gets parent pool-mulleNameUTF8String
- Gets pool name-mulleSetNameUTF8String:
- Sets pool name-mulleContainsObject:
- Checks if pool contains object-mulleCountObject:
- Counts object occurrences-mulleCount
- Gets total object count// Create pool
NSAutoreleasePool *pool = [NSAutoreleasePool new];
// Use @autoreleasepool block (preferred)
@autoreleasepool {
id obj = [[NSObject alloc] init];
[obj autorelease];
}
// Manual pool management
NSAutoreleasePool *pool = [NSAutoreleasePool new];
id obj = [[NSObject alloc] init];
[obj autorelease];
[pool drain];
// Add objects directly
[NSAutoreleasePool addObject:obj];
// Check pool contents
BOOL hasObj = [pool mulleContainsObject:obj];
NSUInteger count = [pool mulleCountObject:obj];