MCPcopy Create free account
hub / github.com/F-Stack/f-stack / extent_alloc_wrapper

Function extent_alloc_wrapper

app/redis-6.2.6/deps/jemalloc/src/extent.c:1457–1484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1455}
1456
1457extent_t *
1458extent_alloc_wrapper(tsdn_t *tsdn, arena_t *arena,
1459 extent_hooks_t **r_extent_hooks, void *new_addr, size_t size, size_t pad,
1460 size_t alignment, bool slab, szind_t szind, bool *zero, bool *commit) {
1461 witness_assert_depth_to_rank(tsdn_witness_tsdp_get(tsdn),
1462 WITNESS_RANK_CORE, 0);
1463
1464 extent_hooks_assure_initialized(arena, r_extent_hooks);
1465
1466 extent_t *extent = extent_alloc_retained(tsdn, arena, r_extent_hooks,
1467 new_addr, size, pad, alignment, slab, szind, zero, commit);
1468 if (extent == NULL) {
1469 if (opt_retain && new_addr != NULL) {
1470 /*
1471 * When retain is enabled and new_addr is set, we do not
1472 * attempt extent_alloc_wrapper_hard which does mmap
1473 * that is very unlikely to succeed (unless it happens
1474 * to be at the end).
1475 */
1476 return NULL;
1477 }
1478 extent = extent_alloc_wrapper_hard(tsdn, arena, r_extent_hooks,
1479 new_addr, size, pad, alignment, slab, szind, zero, commit);
1480 }
1481
1482 assert(extent == NULL || extent_dumpable_get(extent));
1483 return extent;
1484}
1485
1486static bool
1487extent_can_coalesce(arena_t *arena, extents_t *extents, const extent_t *inner,

Callers 3

arena_extent_alloc_largeFunction · 0.85
arena_slab_alloc_hardFunction · 0.85

Calls 5

extent_alloc_retainedFunction · 0.85
extent_dumpable_getFunction · 0.85

Tested by

no test coverage detected