Was this page helpful?
CustomAllocator¶
-
typedef void *(*CassMallocFunction)(size_t size)¶
A custom malloc function. This function should allocate “size” bytes and return a pointer to that memory
See also
See also
- Param size:
[in] The size of the memory to allocate
-
typedef void *(*CassReallocFunction)(void *ptr, size_t size)¶
A custom realloc function. This function attempts to change the size of the memory pointed to by “ptr”. If the memory cannot be resized then new memory should be allocated and contain the contents of the original memory at “ptr”.
See also
See also
See also
- Param ptr:
[in] A pointer to the original memory. If NULL it should behave the same as “CassMallocFunction”
- Param size:
[in] The size of the memory to allocate/resize.
-
typedef void (*CassFreeFunction)(void *ptr)¶
A custom free function. This function deallocates the memory pointed to by “ptr” that was previously allocated by a “CassMallocFunction” or “CassReallocFunction” function.
See also
See also
See also
- Param ptr:
[in] A pointer to memory that should be deallocated. If NULL then this will perform no operation.
-
void cass_alloc_set_functions(CassMallocFunction malloc_func, CassReallocFunction realloc_func, CassFreeFunction free_func)¶
Set custom allocation functions.
Warning: This function is not yet implemented.
Note: This is not thread-safe. The allocation functions must be set before any other library function is called.
Default: The C runtime’s malloc(), realloc() and free()
Important: The C runtime’s malloc(), realloc() and free() will be used by libuv when using versions 1.5 or earlier.
- Parameters:
malloc_func – [in]
realloc_func – [in]
free_func – [in]