3 memcached_set_memory_allocators, memcached_get_memory_allocators - Manage memory allocator functions
7 C Client Library for memcached (libmemcached, -lmemcached)
11 #include <memcached.h>
14 memcached_set_memory_allocators(memcached_st *ptr,
15 memcached_malloc_function mem_malloc,
16 memcached_free_function mem_free,
17 memcached_realloc_function mem_realloc,
18 memcached_calloc_function mem_calloc);
20 void memcached_get_memory_allocators(memcached_st *ptr,
21 memcached_malloc_function *mem_malloc,
22 memcached_free_function *mem_free,
23 memcached_realloc_function *mem_realloc,
24 memcached_calloc_function *mem_calloc);
26 void *(*memcached_malloc_function)(memcached_st *ptr, const size_t size);
27 void *(*memcached_realloc_function)(memcached_st *ptr, void *mem,
29 void (*memcached_free_function)(memcached_st *ptr, void *mem);
30 void *(*memcached_calloc_function)(memcached_st *ptr, size_t nelem,
36 libmemcached(3) allows you to specify your own memory allocators optimized
39 memcached_set_memory_allocators() is used to set the memory allocators used
40 by the memcached instance specified by ptr. Please note that you cannot
41 override only one of the memory allocators, you have to specify a complete
42 new set if you want to override one of them. All of the memory allocation
43 functions should behave as specified in the C99 standard. Specify NULL as
44 all functions to reset them to the default values.
46 memcached_get_memory_allocators() is used to get the currently used memory
47 allocators by a mamcached handle.
49 The first argument to the memory allocator functions is a pointer to a
50 memcached structure, and you may use the memcached_set_user_data() and
51 memcached_get_user_data() to store a user-specific value to each memcached
56 memcached_set_memory_allocators() return MEMCACHED_SUCCESS upon success,
57 and MEMCACHED_FAILURE if you don't pass a complete set of function pointers.
61 To find out more information please check:
62 L<http://tangent.org/552/libmemcached.html>
66 Trond Norbye, E<lt>trond.norbye@sun.comE<gt>
70 memcached(1) libmemcached(3) memcached_get_user_data(3) memcached_set_user_data(3)