Core functions for object allocation and memory management.
MulleObjCInstanceGetAllocator
- Gets allocator for instanceMulleObjCInstanceAllocateMemory
- Allocates zeroed memoryMulleObjCInstanceAllocateNonZeroedMemory
- Allocates raw memoryMulleObjCInstanceReallocateNonZeroedMemory
- Resizes memory blockMulleObjCInstanceDeallocateMemory
- Frees allocated memoryMulleObjCInstanceDuplicateUTF8String
- Copies string using instance allocatorMulleObjCClassGetAllocator
- Gets allocator for classMulleObjCClassAllocateMemory
- Allocates zeroed memoryMulleObjCClassDeallocateMemory
- Frees allocated memoryMulleObjCClassDuplicateUTF8String
- Copies string using class allocatorMulleObjCThreadSetAllocator
- Sets thread-local allocatorMulleObjCThreadGetAllocator
- Gets thread-local allocator// Allocate memory for instance
id obj = self;
void *memory = MulleObjCInstanceAllocateMemory(obj, 1024);
// Use memory
// ...
// Free when done
MulleObjCInstanceDeallocateMemory(obj, memory);