olaf@52: #ifndef ALLOCATOR_H olaf@52: #define ALLOCATOR_H olaf@52: olaf@52: #ifdef __cplusplus olaf@52: extern "C" { olaf@52: #endif olaf@52: olaf@52: typedef void*(*ucx_allocator_malloc)(void *pool, size_t n); olaf@52: typedef void*(*ucx_allocator_calloc)(void *pool, size_t n, size_t size); olaf@52: typedef void*(*ucx_allocator_realloc)(void *pool, void *data, size_t n); olaf@52: olaf@52: typedef struct { olaf@52: void *pool; olaf@52: ucx_allocator_malloc malloc; olaf@52: ucx_allocator_calloc calloc; olaf@52: ucx_allocator_realloc realloc; olaf@52: } UcxAllocator; olaf@52: olaf@52: void *ucx_default_malloc(void *ignore, size_t n); olaf@52: void *ucx_default_calloc(void *ignore, size_t n, size_t size); olaf@52: void *ucx_default_realloc(void *ignore, void *data, size_t n); olaf@52: olaf@52: #define UCX_ALLOCATOR_DEFAULT {NULL, \ olaf@52: ucx_default_malloc, ucx_default_calloc, ucx_default_realloc} olaf@52: olaf@52: #ifdef __cplusplus olaf@52: } olaf@52: #endif olaf@52: olaf@52: #endif /* ALLOCATOR_H */ olaf@52: