#include <axutil_allocator.h>
Public Attributes | |
| void *(* | malloc_fn )(struct axutil_allocator *allocator, size_t size) |
| void *(* | realloc )(struct axutil_allocator *allocator, void *ptr, size_t size) |
| void(* | free_fn )(struct axutil_allocator *allocator, void *ptr) |
| void * | local_pool |
| void * | global_pool |
| void * | current_pool |
Encapsulator for memory allocating routines
| void*( * axutil_allocator::malloc_fn)(struct axutil_allocator *allocator, size_t size) |
Function pointer representing the function that allocates memory.
| allocator | pointer to allocator struct. In the default implementation this is not used, however this parameter is useful when the allocator implementation is dealing with a memory pool. | |
| size | size of the memory block to be allocated |
| void*( * axutil_allocator::realloc)(struct axutil_allocator *allocator, void *ptr, size_t size) |
Function pointer representing the function that re-allocates memory.
| allocator | pointer to allocator struct. In the default implementation this is not used, however this parameter is useful when the allocator implementation is dealing with a memory pool. | |
| ptr | memory block who's size to be changed | |
| size | size of the memory block to be allocated |
| void( * axutil_allocator::free_fn)(struct axutil_allocator *allocator, void *ptr) |
Function pointer representing the function that frees memory.
| allocator | pointer to allocator struct. In the default implementation this is not used, however this parameter is useful when the allocator implementation is dealing with a memory pool. | |
| ptr | pointer to be freed |
Local memory pool. Local pool is used to allocate per request local values.
Global memory pool. Global pool is used to allocate values that live beyond a request
Memory pool currently in use. The functions axutil_allocator_switch_to_global_pool and axutil_allocator_switch_to_local_pool should be used to set the current pool to global pool or to local pool respectively.
1.5.3