b2ac84cb9eb2053c943a91004bf3e6c4228afecd
[m6w6/libmemcached] / docs / memcached_memory_allocators.pod
1 =head1 NAME
2
3 memcached_set_memory_allocators, memcached_get_memory_allocators
4
5 =head1 LIBRARY
6
7 C Client Library for memcached (libmemcached, -lmemcached)
8
9 =head1 SYNOPSIS
10
11 #include <memcached.h>
12
13 memcached_return
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);
19
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);
25
26 void *(*memcached_malloc_function)(memcached_st *ptr, const size_t size);
27 void *(*memcached_realloc_function)(memcached_st *ptr, void *mem,
28 const size_t size);
29 void (*memcached_free_function)(memcached_st *ptr, void *mem);
30 void *(*memcached_calloc_function)(memcached_st *ptr, size_t nelem,
31 const size_t elsize);
32
33
34 =head1 DESCRIPTION
35
36 libmemcached(3) allows you to specify your own memory allocators optimized
37 for your application.
38
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.
45
46 memcached_get_memory_allocators() is used to get the currently used memory
47 allocators by a mamcached handle.
48
49 =head1 RETURN
50
51 memcached_set_memory_allocators() return MEMCACHED_SUCCESS upon success,
52 and MEMCACHED_FAILURE if you don't pass a complete set of function pointers.
53
54 =head1 HOME
55
56 To find out more information please check:
57 L<http://tangent.org/552/libmemcached.html>
58
59 =head1 AUTHOR
60
61 Trond Norbye, E<lt>trond.norbye@sun.comE<gt>
62
63 =head1 SEE ALSO
64
65 memcached(1) libmemcached(3)
66
67 =cut
68