Previous: , Up: Hierarchical Resource Allocation Manager Types   [Index]


13.2.2.2 struct x1f4_e4line_type

typedef struct x1f4_e4line_type {
    int (*deck)(void **), (*fini)(void **, void *),
	(*free)(void *, void *), (*init)(void **, void *, int),
	(*link)(void *, void **, unsigned),
	(*mode)(void *, void **, unsigned),
	(*pick)(void *, void ***, int (*)(void *), unsigned, void **),
	(*slip)(void *, void *, void *, int (*)(void *)),
	(*swap)(void *, void *);
    void *data;
} x1f4_e4line_type;

The x1f4_e4line_type record describe the operation and construction interfaces of per scope/context temporaries allocators.

data

the allocator construction context pointer, passed to the construction methods and not interpreted otherwise

deck

the temporaries collection routine. When called it is passed a pointer to where the allocator address is stored as its sole argument.

The method is expected to return 0 for success, non zero for failure.

fini

the allocator destruction routine. When called, it is passed a pointer to where the object address is stored and the data allocator construction context pointer as arguments, in this order.

The method is expected to return 0 for success, non zero for failure.

free

the memory deallocation method

init

the allocator construction routine. When called, it is passed a pointer where to store the constructed object address, the data allocator construction context pointer and a preallocation hint as arguments, in this order. The preallocation hint will be set to a non zero value if memory allocation are expected, to 0 if none are foreseen.

The method is expected to return 0 for success, non zero for failure.

link

the memory allocation method

mode

the memory reallocation method

pick

the temporary collection routine registering method

slip

the temporary collection procedure unregistering method

swap

the method swapping state for two allocators. It is meant to fully exchange the allocated memory segments and registered collection methods between the two allocators indicated by the method arguments.

The first argument indicates an offline allocator, the second the allocator in use.

The method is expected to return 0 for success, non zero for failure.

The free, link and mode methods abide to the memory allocator construct description. They would be passed the (address of the) object constructed by init as the memory allocation context.

See Memory Allocator Construct.

The pick and slip methods abide to the temporaries allocator construct description. They would be passed the (address of the) object constructed by init as the temporaries allocation context.

See Temporaries Allocator Construct.


Previous: struct x1f4_e4less_type, Up: Hierarchical Resource Allocation Manager Types   [Index]