CFAllocator is an opaque type used to allocate and deallocate memory.
More...
|
typedef const struct __CFAllocator * | CFAllocatorRef |
| A reference to a CFAllocator object.
|
|
typedef void *(* | CFAllocatorAllocateCallBack) (CFIndex allocSize, CFOptionFlags hint, void *info) |
|
typedef void(* | CFAllocatorDeallocateCallBack) (void *ptr, void *info) |
|
typedef void *(* | CFAllocatorReallocateCallBack) (void *ptr, CFIndex newsize, CFOptionFlags hint, void *info) |
|
typedef CFIndex(* | CFAllocatorPreferredSizeCallBack) (CFIndex size, CFOptionFlags hint, void *info) |
|
typedef const void *(* | CFAllocatorRetainCallBack) (const void *info) |
|
typedef void(* | CFAllocatorReleaseCallBack) (const void *info) |
|
typedef CFStringRef(* | CFAllocatorCopyDescriptionCallBack) (const void *info) |
|
|
CFAllocatorRef | CFAllocatorCreate (CFAllocatorRef allocator, CFAllocatorContext *context) |
|
void * | CFAllocatorAllocate (CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint) |
|
void | CFAllocatorDeallocate (CFAllocatorRef allocator, void *ptr) |
|
CFIndex | CFAllocatorGetPreferredSizeForSize (CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint) |
|
void * | CFAllocatorReallocate (CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint) |
|
CFAllocatorRef | CFAllocatorGetDefault (void) |
|
void | CFAllocatorSetDefault (CFAllocatorRef allocator) |
|
void | CFAllocatorGetContext (CFAllocatorRef allocator, CFAllocatorContext *context) |
|
CFTypeID | CFAllocatorGetTypeID (void) |
|
◆ _CFAllocatorContext
struct _CFAllocatorContext |
Data Fields |
CFIndex |
version |
|
void * |
info |
|
CFAllocatorRetainCallBack |
retain |
|
CFAllocatorReleaseCallBack |
release |
|
CFAllocatorCopyDescriptionCallBack |
copyDescription |
|
CFAllocatorAllocateCallBack |
allocate |
|
CFAllocatorReallocateCallBack |
reallocate |
|
CFAllocatorDeallocateCallBack |
deallocate |
|
CFAllocatorPreferredSizeCallBack |
preferredSize |
|
◆ CFAllocatorCreate()
Create a new CFAllocator.
- Parameters
-
allocator | The allocator used to create this allocator or kCFAllocatorUseContext to use the functions in context. |
context | The new allocator's context functions. |
- Returns
- A new CFAllocator or NULL in case of failure.
- See also
- CFAllocatorContext
◆ CFAllocatorAllocate()
Allocate new memory.
- Parameters
-
allocator | The CFAllocator to use. |
size | The number of bytes to allocate. |
hint | Option flags. Currently unused and should be 0. |
- Returns
- Newly allocated memory of NULL in case of failure.
- See also
- CFAllocatorDeallocate()
◆ CFAllocatorDeallocate()
◆ kCFAllocatorDefault
The default allocator and is equivalent to NULL.
- See also
- CFAllocatorGetDefault()
-
CFAllocatorSetDefault()
- Examples
- EXUInt32.c.
◆ kCFAllocatorSystemDefault
The default system allocator is used internally by GNUstep and is the default allocator if none is been defined.
- See also
- CFAllocatorSetDefault()
◆ kCFAllocatorMalloc
An allocator that uses the system's malloc, realloc and free functions.
◆ kCFAllocatorMallocZone
Equivalent to kCFAllocatorSystemDefault
◆ kCFAllocatorNull
The NULL allocator does perform any operations. Can be passed as a deallocator if you do not want GNUstep to deallocate the data.
◆ kCFAllocatorUseContext
This is a special case allocator directing CFAllocatorCreate() to use the given CFAllocatorContext structure to allocate the new allocator.