src/buffer.c

changeset 673
60fb6aec157d
parent 650
77021e06b1a8
child 683
aa0d09f2d81c
equal deleted inserted replaced
672:55d8fdd38ca4 673:60fb6aec157d
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) {

mercurial