ucx/allocator.h

Wed, 10 Oct 2012 14:26:53 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 10 Oct 2012 14:26:53 +0200
changeset 65
7b2f2cab6348
parent 52
34f50d0bada4
child 69
fb59270b1de3
permissions
-rw-r--r--

added _Bool macro for cplusplus

     1 #ifndef ALLOCATOR_H
     2 #define	ALLOCATOR_H
     4 #ifdef	__cplusplus
     5 extern "C" {
     6 #endif
     8 typedef void*(*ucx_allocator_malloc)(void *pool, size_t n);
     9 typedef void*(*ucx_allocator_calloc)(void *pool, size_t n, size_t size);
    10 typedef void*(*ucx_allocator_realloc)(void *pool, void *data, size_t n);
    12 typedef struct {
    13     void *pool;
    14     ucx_allocator_malloc malloc;
    15     ucx_allocator_calloc calloc;
    16     ucx_allocator_realloc realloc;
    17 } UcxAllocator;
    19 void *ucx_default_malloc(void *ignore, size_t n);
    20 void *ucx_default_calloc(void *ignore, size_t n, size_t size);
    21 void *ucx_default_realloc(void *ignore, void *data, size_t n);
    23 #define UCX_ALLOCATOR_DEFAULT {NULL, \
    24         ucx_default_malloc, ucx_default_calloc, ucx_default_realloc}
    26 #ifdef	__cplusplus
    27 }
    28 #endif
    30 #endif	/* ALLOCATOR_H */

mercurial