27 */ |
27 */ |
28 |
28 |
29 #include <stdlib.h> |
29 #include <stdlib.h> |
30 #include "allocator.h" |
30 #include "allocator.h" |
31 |
31 |
|
32 UcxAllocator default_allocator = { |
|
33 NULL, |
|
34 ucx_default_malloc, |
|
35 ucx_default_calloc, |
|
36 ucx_default_realloc, |
|
37 ucx_default_free |
|
38 }; |
|
39 |
|
40 UcxAllocator *ucx_default_allocator() { |
|
41 UcxAllocator *allocator = &default_allocator; |
|
42 return allocator; |
|
43 } |
|
44 |
32 void *ucx_default_malloc(void *ignore, size_t n) { |
45 void *ucx_default_malloc(void *ignore, size_t n) { |
33 return malloc(n); |
46 return malloc(n); |
34 } |
47 } |
35 |
48 |
36 void *ucx_default_calloc(void *ignore, size_t n, size_t size) { |
49 void *ucx_default_calloc(void *ignore, size_t n, size_t size) { |