37 void *space, |
37 void *space, |
38 size_t capacity, |
38 size_t capacity, |
39 CxAllocator const *allocator, |
39 CxAllocator const *allocator, |
40 int flags |
40 int flags |
41 ) { |
41 ) { |
|
42 if (allocator == NULL) allocator = cxDefaultAllocator; |
42 buffer->allocator = allocator; |
43 buffer->allocator = allocator; |
43 buffer->flags = flags; |
44 buffer->flags = flags; |
44 if (!space) { |
45 if (!space) { |
45 buffer->bytes = cxMalloc(allocator, capacity); |
46 buffer->bytes = cxMalloc(allocator, capacity); |
46 if (buffer->bytes == NULL) { |
47 if (buffer->bytes == NULL) { |