MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / je_malloc_usable_size

Function je_malloc_usable_size

deps/jemalloc/src/jemalloc.c:3721–3747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3719}
3720
3721JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW
3722je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) {
3723 size_t ret;
3724 tsdn_t *tsdn;
3725
3726 LOG("core.malloc_usable_size.entry", "ptr: %p", ptr);
3727
3728 assert(malloc_initialized() || IS_INITIALIZER);
3729
3730 tsdn = tsdn_fetch();
3731 check_entry_exit_locking(tsdn);
3732
3733 if (unlikely(ptr == NULL)) {
3734 ret = 0;
3735 } else {
3736 if (config_debug || force_ivsalloc) {
3737 ret = ivsalloc(tsdn, ptr);
3738 assert(force_ivsalloc || ret != 0);
3739 } else {
3740 ret = isalloc(tsdn, ptr);
3741 }
3742 }
3743
3744 check_entry_exit_locking(tsdn);
3745 LOG("core.malloc_usable_size.exit", "result: %zu", ret);
3746 return ret;
3747}
3748
3749/*
3750 * End non-standard functions.

Callers

nothing calls this directly

Calls 5

malloc_initializedFunction · 0.70
check_entry_exit_lockingFunction · 0.70
tsdn_fetchFunction · 0.50
ivsallocFunction · 0.50
isallocFunction · 0.50

Tested by

no test coverage detected