MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_allocator_membuf_realloc

Function acl_allocator_membuf_realloc

lib_acl/src/stdlib/memory/acl_allocator.c:345–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345void *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
362void acl_allocator_membuf_free(const char *filename, int line,
363 ACL_ALLOCATOR *allocator, void *buf)

Callers 2

mempool_reallocFunction · 0.85

Calls 4

acl_default_memstatFunction · 0.85
memcpyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…