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

Function extent_destroy_wrapper

deps/jemalloc/src/extent.c:1877–1905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1875}
1876
1877void
1878extent_destroy_wrapper(tsdn_t *tsdn, arena_t *arena,
1879 extent_hooks_t **r_extent_hooks, extent_t *extent) {
1880 assert(extent_base_get(extent) != NULL);
1881 assert(extent_size_get(extent) != 0);
1882 witness_assert_depth_to_rank(tsdn_witness_tsdp_get(tsdn),
1883 WITNESS_RANK_CORE, 0);
1884
1885 /* Deregister first to avoid a race with other allocating threads. */
1886 extent_deregister(tsdn, extent);
1887
1888 extent_addr_set(extent, extent_base_get(extent));
1889
1890 extent_hooks_assure_initialized(arena, r_extent_hooks);
1891 /* Try to destroy; silently fail otherwise. */
1892 if (*r_extent_hooks == &extent_hooks_default) {
1893 /* Call directly to propagate tsdn. */
1894 extent_destroy_default_impl(extent_base_get(extent),
1895 extent_size_get(extent));
1896 } else if ((*r_extent_hooks)->destroy != NULL) {
1897 extent_hook_pre_reentrancy(tsdn, arena);
1898 (*r_extent_hooks)->destroy(*r_extent_hooks,
1899 extent_base_get(extent), extent_size_get(extent),
1900 extent_committed_get(extent), arena_ind_get(arena));
1901 extent_hook_post_reentrancy(tsdn);
1902 }
1903
1904 extent_dalloc(tsdn, arena, extent);
1905}
1906
1907static bool
1908extent_commit_default(extent_hooks_t *extent_hooks, void *addr, size_t size,

Callers 1

arena_destroy_retainedFunction · 0.70

Calls 13

extent_deregisterFunction · 0.70
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