Up: Non-level Types [Contents][Index]
typedef struct x1f4_trans_type { int (*free) (void *, void *), (*link) (void *, void **, unsigned), (*mode) (void *, void **, unsigned); void *data; } x1f4_trans_type;
The struct x1f4_trans_type
record describes a memory allocation
context.
data
the pointer passed as the first argument to the memory allocation methods.
link
the memory allocation method.
It is passed the memory allocator context, some address to store the address of the newly allocated memory segment at and the minimum size (expressed in bytes) of the memory segment to allocate that will make it usable as arguments, in this order.
The method is expected to return 0
for success, non zero for failure.
mode
the memory reallocation method.
It is passed the memory allocator context, the address at which the address of the memory segment to reallocate is stored and at which the address of the reallocated memory segment is to be stored at and the minimum size (expressed in bytes) of the memory segment to reallocate that will make it usable as arguments, in this order.
The method is not required to recognize NULL
for the segment to
reallocate as not yet allocated and its users will not depends on such
behavior.
The method is expected to return 0
for success, non zero for failure.
free
the memory deallocation method.
It is passed the memory allocator context and the address of the memory segment to deallocate as arguments, in this order.
The method is expected to return 0
for success, non zero for failure.
Up: Non-level Types [Contents][Index]