In Mac OS X, if you need to allocate memory for a task, you can use malloc or the usual Core Foundation allocator functions, and free it using free or CFRelease respectively.
However, in Mac OS 9 and earlier, you must call the function MPAllocateAligned. Doing so returns a pointer to allocated memory with the alignment you specify. Prior to Mac OS X, you should always use the Multiprocessing Services memory allocation functions if your task needs to allocate, deallocate, or otherwise manipulate memory. For example, if your task deallocates its task data structure after it has finished processing, it must call MPFree. Note however, that since the memory is being deallocated by a preemptive task, you must have initially allocated the task record by calling MPAllocateAligned, even if this allocation didn’t occur in a preemptive task.
Last updated: 2007-10-31