1.1 --- a/ucx/allocator.c Fri Jun 21 11:18:24 2013 +0200 1.2 +++ b/ucx/allocator.c Thu Jul 11 17:32:48 2013 +0200 1.3 @@ -29,6 +29,19 @@ 1.4 #include <stdlib.h> 1.5 #include "allocator.h" 1.6 1.7 +UcxAllocator default_allocator = { 1.8 + NULL, 1.9 + ucx_default_malloc, 1.10 + ucx_default_calloc, 1.11 + ucx_default_realloc, 1.12 + ucx_default_free 1.13 +}; 1.14 + 1.15 +UcxAllocator *ucx_default_allocator() { 1.16 + UcxAllocator *allocator = &default_allocator; 1.17 + return allocator; 1.18 +} 1.19 + 1.20 void *ucx_default_malloc(void *ignore, size_t n) { 1.21 return malloc(n); 1.22 } 1.23 @@ -40,3 +53,7 @@ 1.24 void *ucx_default_realloc(void *ignore, void *data, size_t n) { 1.25 return realloc(data, n); 1.26 } 1.27 + 1.28 +void ucx_default_free(void *ignore, void *data) { 1.29 + free(data); 1.30 +}