3 memcached_set_memory_allocators, memcached_get_memory_allocators, memcached_set_memory_allocators_context - 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_fn mem_malloc,
16 memcached_free_fn mem_free,
17 memcached_realloc_fn mem_realloc,
18 memcached_calloc_fn mem_calloc,
22 memcached_get_memory_allocators (memcached_st *ptr,
23 memcached_malloc_fn *mem_malloc,
24 memcached_free_fn *mem_free,
25 memcached_realloc_fn *mem_realloc,
26 memcached_calloc_fn *mem_calloc);
29 memcached_get_memory_allocators_context(const memcached_st *ptr);
32 (*memcached_malloc_fn) (memcached_st *ptr, const size_t size,
36 (*memcached_realloc_fn) (memcached_st *ptr, void *mem,
41 (*memcached_free_fn) (memcached_st *ptr, void *mem,
45 (*memcached_calloc_fn) (memcached_st *ptr,
53 libmemcached(3) allows you to specify your own memory allocators optimized
56 memcached_set_memory_allocators() is used to set the memory allocators used
57 by the memcached instance specified by ptr. Please note that you cannot
58 override only one of the memory allocators, you have to specify a complete
59 new set if you want to override one of them. All of the memory allocation
60 functions should behave as specified in the C99 standard. Specify NULL as
61 all functions to reset them to the default values.
63 memcached_get_memory_allocators() is used to get the currently used memory
64 allocators by a mamcached handle.
66 memcached_get_memory_allocators_context() returns the void * that was
67 passed in during the call to memcached_set_memory_allocators().
69 The first argument to the memory allocator functions is a pointer to a
70 memcached structure, the is passed as const and you will need to clone
71 it in order to make use of any operation which would modify it.
75 In version 0.38 all functions were modified to have a context void pointer
76 passed to them. This was so that customer allocators could have their
81 memcached_set_memory_allocators() return MEMCACHED_SUCCESS upon success,
82 and MEMCACHED_FAILURE if you don't pass a complete set of function pointers.
86 To find out more information please check:
87 L<https://launchpad.net/libmemcached>
91 Trond Norbye, E<lt>trond.norbye@gmail.comE<gt>
92 Brian Aker, E<lt>brian@tangent.orf<gt>
96 memcached(1) libmemcached(3) memcached_get_user_data(3) memcached_set_user_data(3)