diff -r a54115d554f7 -r 86b19c98b5fd ucx/allocator.c --- a/ucx/allocator.c Fri Jun 21 11:18:24 2013 +0200 +++ b/ucx/allocator.c Thu Jul 11 17:32:48 2013 +0200 @@ -29,6 +29,19 @@ #include #include "allocator.h" +UcxAllocator default_allocator = { + NULL, + ucx_default_malloc, + ucx_default_calloc, + ucx_default_realloc, + ucx_default_free +}; + +UcxAllocator *ucx_default_allocator() { + UcxAllocator *allocator = &default_allocator; + return allocator; +} + void *ucx_default_malloc(void *ignore, size_t n) { return malloc(n); } @@ -40,3 +53,7 @@ void *ucx_default_realloc(void *ignore, void *data, size_t n) { return realloc(data, n); } + +void ucx_default_free(void *ignore, void *data) { + free(data); +}