114 size_t n |
115 size_t n |
115 ) { |
116 ) { |
116 return allocator->cl->malloc(allocator->data, n); |
117 return allocator->cl->malloc(allocator->data, n); |
117 } |
118 } |
118 |
119 |
|
120 void *cxZalloc( |
|
121 const CxAllocator *allocator, |
|
122 size_t n |
|
123 ) { |
|
124 void *mem = allocator->cl->malloc(allocator->data, n); |
|
125 if (mem != NULL) { |
|
126 memset(mem, 0, n); |
|
127 } |
|
128 return mem; |
|
129 } |
|
130 |
119 void *cxRealloc( |
131 void *cxRealloc( |
120 const CxAllocator *allocator, |
132 const CxAllocator *allocator, |
121 void *mem, |
133 void *mem, |
122 size_t n |
134 size_t n |
123 ) { |
135 ) { |