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

Function extent_dalloc_wrapper_try

deps/jemalloc/src/extent.c:1772–1804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1770}
1771
1772static bool
1773extent_dalloc_wrapper_try(tsdn_t *tsdn, arena_t *arena,
1774 extent_hooks_t **r_extent_hooks, extent_t *extent) {
1775 bool err;
1776
1777 assert(extent_base_get(extent) != NULL);
1778 assert(extent_size_get(extent) != 0);
1779 witness_assert_depth_to_rank(tsdn_witness_tsdp_get(tsdn),
1780 WITNESS_RANK_CORE, 0);
1781
1782 extent_addr_set(extent, extent_base_get(extent));
1783
1784 extent_hooks_assure_initialized(arena, r_extent_hooks);
1785 /* Try to deallocate. */
1786 if (*r_extent_hooks == &extent_hooks_default) {
1787 /* Call directly to propagate tsdn. */
1788 err = extent_dalloc_default_impl(extent_base_get(extent),
1789 extent_size_get(extent));
1790 } else {
1791 extent_hook_pre_reentrancy(tsdn, arena);
1792 err = ((*r_extent_hooks)->dalloc == NULL ||
1793 (*r_extent_hooks)->dalloc(*r_extent_hooks,
1794 extent_base_get(extent), extent_size_get(extent),
1795 extent_committed_get(extent), arena_ind_get(arena)));
1796 extent_hook_post_reentrancy(tsdn);
1797 }
1798
1799 if (!err) {
1800 extent_dalloc(tsdn, arena, extent);
1801 }
1802
1803 return err;
1804}
1805
1806void
1807extent_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena,

Callers 1

extent_dalloc_wrapperFunction · 0.70

Calls 11

extent_dallocFunction · 0.70
extent_base_getFunction · 0.50
extent_size_getFunction · 0.50
extent_addr_setFunction · 0.50
extent_committed_getFunction · 0.50
arena_ind_getFunction · 0.50

Tested by

no test coverage detected