9 memcached_set_memory_allocators, memcached_get_memory_allocators, memcached_set_memory_allocators_context - Manage memory allocator functions
17 C Client Library for memcached (libmemcached, -lmemcached)
28 #include <memcached.h>
31 memcached_set_memory_allocators (memcached_st *ptr,
32 memcached_malloc_fn mem_malloc,
33 memcached_free_fn mem_free,
34 memcached_realloc_fn mem_realloc,
35 memcached_calloc_fn mem_calloc,
39 memcached_get_memory_allocators (memcached_st *ptr,
40 memcached_malloc_fn *mem_malloc,
41 memcached_free_fn *mem_free,
42 memcached_realloc_fn *mem_realloc,
43 memcached_calloc_fn *mem_calloc);
46 memcached_get_memory_allocators_context(const memcached_st *ptr);
49 (*memcached_malloc_fn) (memcached_st *ptr, const size_t size,
53 (*memcached_realloc_fn) (memcached_st *ptr, void *mem,
58 (*memcached_free_fn) (memcached_st *ptr, void *mem,
62 (*memcached_calloc_fn) (memcached_st *ptr,
74 libmemcached(3) allows you to specify your own memory allocators optimized
77 memcached_set_memory_allocators() is used to set the memory allocators used
78 by the memcached instance specified by ptr. Please note that you cannot
79 override only one of the memory allocators, you have to specify a complete
80 new set if you want to override one of them. All of the memory allocation
81 functions should behave as specified in the C99 standard. Specify NULL as
82 all functions to reset them to the default values.
84 memcached_get_memory_allocators() is used to get the currently used memory
85 allocators by a mamcached handle.
87 memcached_get_memory_allocators_context() returns the void \* that was
88 passed in during the call to memcached_set_memory_allocators().
90 The first argument to the memory allocator functions is a pointer to a
91 memcached structure, the is passed as const and you will need to clone
92 it in order to make use of any operation which would modify it.
100 In version 0.38 all functions were modified to have a context void pointer
101 passed to them. This was so that customer allocators could have their
102 own space for memory.
110 memcached_set_memory_allocators() return MEMCACHED_SUCCESS upon success,
111 and MEMCACHED_FAILURE if you don't pass a complete set of function pointers.
119 To find out more information please check:
120 `https://launchpad.net/libmemcached <https://launchpad.net/libmemcached>`_
128 Trond Norbye, <trond.norbye@gmail.com>
129 Brian Aker, <brian@tangent.orf<gt>
137 memcached(1) libmemcached(3) memcached_get_user_data(3) memcached_set_user_data(3)