Add docs for tap, and update all other documentation.
[m6w6/libmemcached] / docs / man / memcached_set_memory_allocators.3
1 .TH "MEMCACHED_SET_MEMORY_ALLOCATORS" "3" "April 11, 2011" "0.47" "libmemcached"
2 .SH NAME
3 memcached_set_memory_allocators \- libmemcached Documentation
4 .
5 .nr rst2man-indent-level 0
6 .
7 .de1 rstReportMargin
8 \\$1 \\n[an-margin]
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
11 -
12 \\n[rst2man-indent0]
13 \\n[rst2man-indent1]
14 \\n[rst2man-indent2]
15 ..
16 .de1 INDENT
17 .\" .rstReportMargin pre:
18 . RS \\$1
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
22 ..
23 .de UNINDENT
24 . RE
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30 ..
31 .\" Man page generated from reStructeredText.
32 .
33 .sp
34 Manage memory allocator functions
35 .SH LIBRARY
36 .sp
37 C Client Library for memcached (libmemcached, \-lmemcached)
38 .SH SYNOPSIS
39 .sp
40 .nf
41 .ft C
42 #include <libmemcached/memcached.h>
43
44 memcached_return_t memcached_set_memory_allocators (memcached_st *ptr, memcached_malloc_fn mem_malloc, memcached_free_fn mem_free, memcached_realloc_fn mem_realloc, memcached_calloc_fn mem_calloc, void *context);
45
46 void memcached_get_memory_allocators (memcached_st *ptr, memcached_malloc_fn *mem_malloc, memcached_free_fn *mem_free, memcached_realloc_fn *mem_realloc, memcached_calloc_fn *mem_calloc);
47
48 void * memcached_get_memory_allocators_context(const memcached_st *ptr);
49
50 void * (*memcached_malloc_fn) (memcached_st *ptr, const size_t size, void *context);
51
52 void * (*memcached_realloc_fn) (memcached_st *ptr, void *mem, const size_t size, void *context);
53
54 void (*memcached_free_fn) (memcached_st *ptr, void *mem, void *context);
55
56 void * (*memcached_calloc_fn) (memcached_st *ptr, size_t nelem, const size_t elsize, void *context);
57 .ft P
58 .fi
59 .SH DESCRIPTION
60 .sp
61 libmemcached(3) allows you to specify your own memory allocators optimized
62 for your application. This enables libmemcached to be used inside of applications that have their own malloc implementation.
63 .sp
64 memcached_set_memory_allocators() is used to set the memory allocators used
65 by the memcached instance specified by ptr. Please note that you cannot
66 override only one of the memory allocators, you have to specify a complete
67 new set if you want to override one of them. All of the memory allocation
68 functions should behave as specified in the C99 standard. Specify NULL as
69 all functions to reset them to the default values.
70 .sp
71 memcached_get_memory_allocators() is used to get the currently used memory
72 allocators by a mamcached handle.
73 .sp
74 memcached_get_memory_allocators_context() returns the void * that was
75 passed in during the call to memcached_set_memory_allocators().
76 .sp
77 The first argument to the memory allocator functions is a pointer to a
78 memcached structure, the is passed as const and you will need to clone
79 it in order to make use of any operation which would modify it.
80 .SH NOTES
81 .sp
82 In version 0.38 all functions were modified to have a context void pointer
83 passed to them. This was so that customer allocators could have their
84 own space for memory.
85 .SH RETURN
86 .sp
87 memcached_set_memory_allocators() return MEMCACHED_SUCCESS upon success,
88 and MEMCACHED_FAILURE if you don\(aqt pass a complete set of function pointers.
89 .SH HOME
90 .sp
91 To find out more information please check:
92 \fI\%https://launchpad.net/libmemcached\fP
93 .SH SEE ALSO
94 .sp
95 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
96 .SH AUTHOR
97 Brian Aker
98 .SH COPYRIGHT
99 2011, Brian Aker DataDifferential, http://datadifferential.com/
100 .\" Generated by docutils manpage writer.
101 .\"
102 .