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

Function arenas_create_ctl

deps/jemalloc/src/ctl.c:2581–2602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2579}
2580
2581static int
2582arenas_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
2583 void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
2584 int ret;
2585 extent_hooks_t *extent_hooks;
2586 unsigned arena_ind;
2587
2588 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx);
2589
2590 extent_hooks = (extent_hooks_t *)&extent_hooks_default;
2591 WRITE(extent_hooks, extent_hooks_t *);
2592 if ((arena_ind = ctl_arena_init(tsd, extent_hooks)) == UINT_MAX) {
2593 ret = EAGAIN;
2594 goto label_return;
2595 }
2596 READ(arena_ind, unsigned);
2597
2598 ret = 0;
2599label_return:
2600 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx);
2601 return ret;
2602}
2603
2604static int
2605arenas_lookup_ctl(tsd_t *tsd, const size_t *mib,

Callers

nothing calls this directly

Calls 4

ctl_arena_initFunction · 0.70
malloc_mutex_lockFunction · 0.50
tsd_tsdnFunction · 0.50
malloc_mutex_unlockFunction · 0.50

Tested by

no test coverage detected