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

Function acl_slice_pool_realloc

lib_acl/src/stdlib/memory/acl_slice.c:1356–1374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1354}
1355
1356void *acl_slice_pool_realloc(const char *filename, int line,
1357 ACL_SLICE_POOL *asp, void *ptr, size_t size)
1358{
1359 void *buf;
1360
1361 buf = acl_slice_pool_alloc(filename, line, asp, size);
1362 if (ptr != NULL) {
1363 size_t old_size = *(((size_t*) ptr) - 1);
1364 if (old_size == 0) {
1365 old_size = *(((size_t*) ptr) - 2);
1366 if (old_size == 0) {
1367 abort();
1368 }
1369 }
1370 memcpy(buf, ptr, old_size);
1371 }
1372 acl_slice_pool_free(filename, line, ptr);
1373 return buf;
1374}
1375
1376void *acl_slice_pool_memdup(const char *filename, int line,
1377 ACL_SLICE_POOL *asp, const void *ptr, size_t len)

Callers 1

vstring_extendFunction · 0.85

Calls 3

acl_slice_pool_allocFunction · 0.85
memcpyFunction · 0.85
acl_slice_pool_freeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…