MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / dlrealloc

Function dlrealloc

dlmalloc/dlmalloc.c:4618–4639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4616}
4617
4618void* dlrealloc(void* oldmem, size_t bytes) {
4619 if (oldmem == 0)
4620 return dlmalloc(bytes);
4621#ifdef REALLOC_ZERO_BYTES_FREES
4622 if (bytes == 0) {
4623 dlfree(oldmem);
4624 return 0;
4625 }
4626#endif /* REALLOC_ZERO_BYTES_FREES */
4627 else {
4628#if ! FOOTERS
4629 mstate m = gm;
4630#else /* FOOTERS */
4631 mstate m = get_mstate_for(mem2chunk(oldmem));
4632 if (!ok_magic(m)) {
4633 USAGE_ERROR_ACTION(m, oldmem);
4634 return 0;
4635 }
4636#endif /* FOOTERS */
4637 return internal_realloc(m, oldmem, bytes, 1);
4638 }
4639}
4640
4641void* dlmemalign(size_t alignment, size_t bytes) {
4642 return internal_memalign(gm, alignment, bytes);

Callers 1

dl_reallocFunction · 0.85

Calls 3

dlmallocFunction · 0.85
dlfreeFunction · 0.85
internal_reallocFunction · 0.85

Tested by

no test coverage detected