src/cx/allocator.h

changeset 415
067aa769796a
parent 414
81a4c3a63e65
child 419
b5d6cb88d05d
equal deleted inserted replaced
414:81a4c3a63e65 415:067aa769796a
29 #ifndef UCX_ALLOCATOR_H 29 #ifndef UCX_ALLOCATOR_H
30 #define UCX_ALLOCATOR_H 30 #define UCX_ALLOCATOR_H
31 31
32 #include <stdlib.h> 32 #include <stdlib.h>
33 33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
34 typedef struct { 38 typedef struct {
35 void *(*malloc)(void *data, size_t n); 39 void *(*malloc)(void *data, size_t n);
36 void *(*realloc)(void *data, void *mem, size_t n); 40 void *(*realloc)(void *data, void *mem, size_t n);
37 void *(*calloc)(void *data, size_t nelem, size_t n); 41 void *(*calloc)(void *data, size_t nelem, size_t n);
38 void(*free)(void *data, void *mem); 42 void(*free)(void *data, void *mem);
56 60
57 void *cxCalloc(CxAllocator allocator, size_t nelem, size_t n); 61 void *cxCalloc(CxAllocator allocator, size_t nelem, size_t n);
58 62
59 void cxFree(CxAllocator allocator, void *mem); 63 void cxFree(CxAllocator allocator, void *mem);
60 64
65 #ifdef __cplusplus
66 } /* extern "C" */
67 #endif
68
61 #endif /* UCX_ALLOCATOR_H */ 69 #endif /* UCX_ALLOCATOR_H */

mercurial