CFAllocatorCreate |
||||
Header: | CFBase.h | Carbon status: | Supported | |
Creates an allocator object.
CFAllocatorRef CFAllocatorCreate ( CFAllocatorRef allocator, CFAllocatorContext *context );
A reference of type CFAllocatorRef that refers to a existing allocator object that will be used for allocating memory for the new allocator. Pass the kCFAllocatorUseContext constant for this parameter if you want to allocate memory using the appropriate function callback specified in the context parameter. Pass NULL if you want to allocate memory for the new allocator using the default allocator.
A structure of type CFAllocatorContext. The fields of this structure hold (among other things) function pointers to callbacks used for allocating, reallocating, and deallocating memory.
A reference to an allocator object or NULL if there is a problem allocating memory.
The CFAllocatorCreate function creates an allocator object and returns a reference of type CFAllocatorRef to it. You use this function to create custom allocators which you can then pass into various Core Foundation object-creation functions. You must implement a function callback that allocates memory and assign it to the allocate field of this structure. You probably will also have to implement deallocate, reallocate, and preferred-size callbacks.
Supported in Carbon. Available in Carbon 1.0.2 and later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)