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

Function arena_init_locked

app/redis-6.2.6/deps/jemalloc/src/jemalloc.c:311–337  ·  view source on GitHub ↗

Create a new arena and insert it into the arenas array at index ind. */

Source from the content-addressed store, hash-verified

309
310/* Create a new arena and insert it into the arenas array at index ind. */
311static arena_t *
312arena_init_locked(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks) {
313 arena_t *arena;
314
315 assert(ind <= narenas_total_get());
316 if (ind >= MALLOCX_ARENA_LIMIT) {
317 return NULL;
318 }
319 if (ind == narenas_total_get()) {
320 narenas_total_inc();
321 }
322
323 /*
324 * Another thread may have already initialized arenas[ind] if it's an
325 * auto arena.
326 */
327 arena = arena_get(tsdn, ind, false);
328 if (arena != NULL) {
329 assert(ind < narenas_auto);
330 return arena;
331 }
332
333 /* Actually initialize the arena. */
334 arena = arena_new(tsdn, ind, extent_hooks);
335
336 return arena;
337}
338
339static void
340arena_new_create_background_thread(tsdn_t *tsdn, unsigned ind) {

Callers 2

arena_initFunction · 0.85
arena_choose_hardFunction · 0.85

Calls 4

narenas_total_getFunction · 0.85
narenas_total_incFunction · 0.85
arena_getFunction · 0.85
arena_newFunction · 0.85

Tested by

no test coverage detected