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

Function extent_dalloc_unmap

deps/jemalloc/test/unit/arena_reset.c:262–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260 do_arena_destroy(arena_ind_another);
261}
262TEST_END
263
264/*
265 * Actually unmap extents, regardless of opt_retain, so that attempts to access
266 * a destroyed arena's memory will segfault.
267 */
268static bool
269extent_dalloc_unmap(extent_hooks_t *extent_hooks, void *addr, size_t size,
270 bool committed, unsigned arena_ind) {
271 TRACE_HOOK("%s(extent_hooks=%p, addr=%p, size=%zu, committed=%s, "
272 "arena_ind=%u)\n", __func__, extent_hooks, addr, size, committed ?
273 "true" : "false", arena_ind);
274 assert_ptr_eq(extent_hooks, &hooks,
275 "extent_hooks should be same as pointer used to set hooks");
276 assert_ptr_eq(extent_hooks->dalloc, extent_dalloc_unmap,
277 "Wrong hook function");
278 called_dalloc = true;
279 if (!try_dalloc) {
280 return true;
281 }
282 did_dalloc = true;
283 if (!maps_coalesce && opt_retain) {
284 return true;
285 }
286 pages_unmap(addr, size);
287 return false;
288}
289
290static extent_hooks_t hooks_orig;
291

Callers

nothing calls this directly

Calls 1

pages_unmapFunction · 0.50

Tested by

no test coverage detected