1memcached_get_memory_allomceamtcoarcsh.epdo_pg(e3t)_memmoermyc_aaclhleodc_agteotr_smemory_allocators.pop(3)
2
3
4

NAME

6       memcached_set_memory_allocators, memcached_get_memory_allocators,
7       memcached_set_memory_allocators_context - Manage memory allocator
8       functions
9

LIBRARY

11       C Client Library for memcached (libmemcached, -lmemcached)
12

SYNOPSIS

14         #include <memcached.h>
15
16         memcached_return_t
17           memcached_set_memory_allocators (memcached_st *ptr,
18                                            memcached_malloc_fn mem_malloc,
19                                            memcached_free_fn mem_free,
20                                            memcached_realloc_fn mem_realloc,
21                                            memcached_calloc_fn mem_calloc,
22                                            void *context);
23
24         void
25           memcached_get_memory_allocators (memcached_st *ptr,
26                                            memcached_malloc_fn *mem_malloc,
27                                            memcached_free_fn *mem_free,
28                                            memcached_realloc_fn *mem_realloc,
29                                            memcached_calloc_fn *mem_calloc);
30
31         void *
32           memcached_get_memory_allocators_context(const memcached_st *ptr);
33
34         void *
35           (*memcached_malloc_fn) (memcached_st *ptr, const size_t size,
36                                   void *context);
37
38         void *
39           (*memcached_realloc_fn) (memcached_st *ptr, void *mem,
40                                    const size_t size,
41                                    void *context);
42
43         void
44           (*memcached_free_fn) (memcached_st *ptr, void *mem,
45                                 void *context);
46
47         void *
48         (*memcached_calloc_fn) (memcached_st *ptr,
49                                 size_t nelem,
50                                 const size_t elsize,
51                                 void *context);
52

DESCRIPTION

54       libmemcached(3) allows you to specify your own memory allocators
55       optimized for your application.
56
57       memcached_set_memory_allocators() is used to set the memory allocators
58       used by the memcached instance specified by ptr. Please note that you
59       cannot override only one of the memory allocators, you have to specify
60       a complete new set if you want to override one of them. All of the
61       memory allocation functions should behave as specified in the C99
62       standard. Specify NULL as all functions to reset them to the default
63       values.
64
65       memcached_get_memory_allocators() is used to get the currently used
66       memory allocators by a mamcached handle.
67
68       memcached_get_memory_allocators_context() returns the void * that was
69       passed in during the call to memcached_set_memory_allocators().
70
71       The first argument to the memory allocator functions is a pointer to a
72       memcached structure, the is passed as const and you will need to clone
73       it in order to make use of any operation which would modify it.
74

NOTES

76       In version 0.38 all functions were modified to have a context void
77       pointer passed to them. This was so that customer allocators could have
78       their own space for memory.
79

RETURN

81       memcached_set_memory_allocators() return MEMCACHED_SUCCESS upon
82       success, and MEMCACHED_FAILURE if you don't pass a complete set of
83       function pointers.
84

HOME

86       To find out more information please check:
87       <https://launchpad.net/libmemcached>
88

AUTHOR

90       Trond Norbye, <trond.norbye@gmail.com> Brian Aker,
91       <brian@tangent.orf<gt>
92

SEE ALSO

94       memcached(1) libmemcached(3) memcached_get_user_data(3)
95       memcached_set_user_data(3)
96
97
98
99                                  2010-06m-e2m8cached_get_memory_allocators.pop(3)
Impressum