ucx/allocator.h

changeset 52
34f50d0bada4
parent 50
ff194559eb41
child 69
fb59270b1de3
     1.1 --- a/ucx/allocator.h	Fri Oct 05 14:06:40 2012 +0200
     1.2 +++ b/ucx/allocator.h	Fri Oct 05 16:59:14 2012 +0200
     1.3 @@ -1,32 +1,31 @@
     1.4 -#ifndef ALLOCATOR_H
     1.5 -#define ALLOCATOR_H
     1.6 -
     1.7 -#include <stddef.h>
     1.8 -
     1.9 -#ifdef  __cplusplus
    1.10 -extern "C" {
    1.11 -#endif
    1.12 -
    1.13 -typedef void*(*ucx_allocator_malloc)(void *pool, size_t n);
    1.14 -typedef void*(*ucx_allocator_calloc)(void *pool, size_t n, size_t size);
    1.15 -typedef void*(*ucx_allocator_realloc)(void *pool, void *data, size_t n);
    1.16 -
    1.17 -typedef struct {
    1.18 -    void *pool;
    1.19 -    ucx_allocator_malloc malloc;
    1.20 -    ucx_allocator_calloc calloc;
    1.21 -    ucx_allocator_realloc realloc;
    1.22 -} UcxAllocator;
    1.23 -
    1.24 -void *ucx_default_malloc(void *ignore, size_t n);
    1.25 -void *ucx_default_calloc(void *ignore, size_t n, size_t size);
    1.26 -void *ucx_default_realloc(void *ignore, void *data, size_t n);
    1.27 -
    1.28 -#define UCX_ALLOCATOR_DEFAULT {NULL, \
    1.29 -    ucx_default_malloc, ucx_default_calloc, ucx_default_realloc}
    1.30 -
    1.31 -#ifdef  __cplusplus
    1.32 -}
    1.33 -#endif
    1.34 -
    1.35 -#endif /* ALLOCATOR_H */
    1.36 +#ifndef ALLOCATOR_H
    1.37 +#define	ALLOCATOR_H
    1.38 +
    1.39 +#ifdef	__cplusplus
    1.40 +extern "C" {
    1.41 +#endif
    1.42 +
    1.43 +typedef void*(*ucx_allocator_malloc)(void *pool, size_t n);
    1.44 +typedef void*(*ucx_allocator_calloc)(void *pool, size_t n, size_t size);
    1.45 +typedef void*(*ucx_allocator_realloc)(void *pool, void *data, size_t n);
    1.46 +
    1.47 +typedef struct {
    1.48 +    void *pool;
    1.49 +    ucx_allocator_malloc malloc;
    1.50 +    ucx_allocator_calloc calloc;
    1.51 +    ucx_allocator_realloc realloc;
    1.52 +} UcxAllocator;
    1.53 +
    1.54 +void *ucx_default_malloc(void *ignore, size_t n);
    1.55 +void *ucx_default_calloc(void *ignore, size_t n, size_t size);
    1.56 +void *ucx_default_realloc(void *ignore, void *data, size_t n);
    1.57 +
    1.58 +#define UCX_ALLOCATOR_DEFAULT {NULL, \
    1.59 +        ucx_default_malloc, ucx_default_calloc, ucx_default_realloc}
    1.60 +
    1.61 +#ifdef	__cplusplus
    1.62 +}
    1.63 +#endif
    1.64 +
    1.65 +#endif	/* ALLOCATOR_H */
    1.66 +

mercurial