| 343 | } |
| 344 | |
| 345 | void *acl_allocator_membuf_realloc(const char *filename, int line, |
| 346 | ACL_ALLOCATOR *allocator, void *oldbuf, size_t size) |
| 347 | { |
| 348 | /* XXX This can be optimized on very large buffers to use realloc() */ |
| 349 | void *newbuf = acl_allocator_membuf_alloc(filename, line, |
| 350 | allocator, size); |
| 351 | |
| 352 | if (oldbuf) { |
| 353 | size_t data_size; |
| 354 | |
| 355 | acl_default_memstat(filename, line, oldbuf, &data_size, NULL); |
| 356 | memcpy(newbuf, oldbuf, data_size > size ? size : data_size); |
| 357 | acl_allocator_membuf_free(filename, line, allocator, oldbuf); |
| 358 | } |
| 359 | return newbuf; |
| 360 | } |
| 361 | |
| 362 | void acl_allocator_membuf_free(const char *filename, int line, |
| 363 | ACL_ALLOCATOR *allocator, void *buf) |
no test coverage detected
searching dependent graphs…