2 * Copyright (C) 2010 Brian Aker
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
8 * Summary: work with user defined memory allocators
12 #ifndef __LIBMEMCACHED_ALLOCATORS_H__
13 #define __LIBMEMCACHED_ALLOCATORS_H__
20 memcached_return_t
memcached_set_memory_allocators(memcached_st
*ptr
,
21 memcached_malloc_fn mem_malloc
,
22 memcached_free_fn mem_free
,
23 memcached_realloc_fn mem_realloc
,
24 memcached_calloc_fn mem_calloc
,
28 void memcached_get_memory_allocators(const memcached_st
*ptr
,
29 memcached_malloc_fn
*mem_malloc
,
30 memcached_free_fn
*mem_free
,
31 memcached_realloc_fn
*mem_realloc
,
32 memcached_calloc_fn
*mem_calloc
);
35 void *memcached_get_memory_allocators_context(const memcached_st
*ptr
);
38 void _libmemcached_free(const memcached_st
*ptr
, void *mem
, void *context
);
41 void *_libmemcached_malloc(const memcached_st
*ptr
, const size_t size
, void *context
);
44 void *_libmemcached_realloc(const memcached_st
*ptr
, void *mem
, const size_t size
, void *context
);
47 void *_libmemcached_calloc(const memcached_st
*ptr
, size_t nelem
, size_t size
, void *context
);
50 struct _allocators_st
memcached_allocators_return_default(void);
56 #endif /* __LIBMEMCACHED_ALLOCATORS_H__ */