libneo4j-client-2.2.0
|
A memory allocator for neo4j client. More...
#include <neo4j-client.h>
Data Fields | |
void *(* | alloc )(struct neo4j_memory_allocator *self, void *context, size_t size) |
Allocate memory from this allocator. More... | |
void *(* | calloc )(struct neo4j_memory_allocator *self, void *context, size_t count, size_t size) |
Allocate memory for consecutive objects from this allocator. More... | |
void(* | free )(struct neo4j_memory_allocator *self, void *ptr) |
Return memory to this allocator. More... | |
void(* | vfree )(struct neo4j_memory_allocator *self, void **ptrs, size_t n) |
Return multiple memory regions to this allocator. More... | |
A memory allocator for neo4j client.
This will be used to allocate regions of memory as required by a connection, for buffers, etc.
void*(* neo4j_memory_allocator::alloc) (struct neo4j_memory_allocator *self, void *context, size_t size) |
Allocate memory from this allocator.
[self] | This allocator. |
[context] | An opaque 'context' for the allocation, which an allocator may use to try an optimize storage as memory allocated with the same context is likely (but not guaranteed) to be all deallocated at the same time. Context may be NULL , in which case it does not offer any guidance on deallocation. |
[size] | The amount of memory (in bytes) to allocate. |
NULL
on error (errno will be set). void*(* neo4j_memory_allocator::calloc) (struct neo4j_memory_allocator *self, void *context, size_t count, size_t size) |
Allocate memory for consecutive objects from this allocator.
Allocates contiguous space for multiple objects of the specified size, and fills the space with bytes of value zero.
[self] | This allocator. |
[context] | An opaque 'context' for the allocation, which an allocator may use to try an optimize storage as memory allocated with the same context is likely (but not guaranteed) to be all deallocated at the same time. Context may be NULL , in which case it does not offer any guidance on deallocation. |
[count] | The number of objects to allocate. |
[size] | The size (in bytes) of each object. |
NULL
on error (errno will be set). void(* neo4j_memory_allocator::free) (struct neo4j_memory_allocator *self, void *ptr) |
Return memory to this allocator.
[self] | This allocator. |
[ptr] | A pointer to the memory being returned. |
void(* neo4j_memory_allocator::vfree) (struct neo4j_memory_allocator *self, void **ptrs, size_t n) |
Return multiple memory regions to this allocator.
[self] | This allocator. |
[ptrs] | An array of pointers to memory for returning. |
[n] | The length of the pointer array. |