| 3719 | } |
| 3720 | |
| 3721 | JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW |
| 3722 | je_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. |
nothing calls this directly
no test coverage detected