Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 7.04 KB

MulleObjCAllocation.md

File metadata and controls

50 lines (36 loc) · 7.04 KB

MulleObjCAllocation

Core functions for object allocation and memory management.

Instance Functions

Class Functions

Thread Functions

Usage Example

// Allocate memory for instance
id obj = self;
void *memory = MulleObjCInstanceAllocateMemory(obj, 1024);

// Use memory
// ...

// Free when done
MulleObjCInstanceDeallocateMemory(obj, memory);

Important Notes

  1. Memory Management

    • All allocations must be freed with corresponding deallocate function
    • Use instance allocator for instance-specific memory
    • Use class allocator for shared class memory
  2. Thread Safety

    • Allocation functions are thread-safe
    • Each thread can have its own allocator
    • Thread allocator affects all allocations in that thread