ucx/allocator.h

Wed, 27 Feb 2013 14:52:52 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 27 Feb 2013 14:52:52 +0100
changeset 99
4566ef29f16b
parent 69
fb59270b1de3
child 103
08018864fb91
permissions
-rw-r--r--

fixed suncc makefiles

     1 #ifndef ALLOCATOR_H
     2 #define	ALLOCATOR_H
     4 #include "ucx.h"
     6 #ifdef	__cplusplus
     7 extern "C" {
     8 #endif
    10 typedef void*(*ucx_allocator_malloc)(void *pool, size_t n);
    11 typedef void*(*ucx_allocator_calloc)(void *pool, size_t n, size_t size);
    12 typedef void*(*ucx_allocator_realloc)(void *pool, void *data, size_t n);
    14 typedef struct {
    15     void *pool;
    16     ucx_allocator_malloc malloc;
    17     ucx_allocator_calloc calloc;
    18     ucx_allocator_realloc realloc;
    19 } UcxAllocator;
    21 void *ucx_default_malloc(void *ignore, size_t n);
    22 void *ucx_default_calloc(void *ignore, size_t n, size_t size);
    23 void *ucx_default_realloc(void *ignore, void *data, size_t n);
    25 #define UCX_ALLOCATOR_DEFAULT {NULL, \
    26         ucx_default_malloc, ucx_default_calloc, ucx_default_realloc}
    28 #ifdef	__cplusplus
    29 }
    30 #endif
    32 #endif	/* ALLOCATOR_H */

mercurial