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

Function malloc_init_hard_recursible

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

Initialize data structures which may trigger recursive allocation. */

Source from the content-addressed store, hash-verified

1343
1344/* Initialize data structures which may trigger recursive allocation. */
1345static bool
1346malloc_init_hard_recursible(void) {
1347 malloc_init_state = malloc_init_recursible;
1348
1349 ncpus = malloc_ncpus();
1350
1351#if (defined(JEMALLOC_HAVE_PTHREAD_ATFORK) && !defined(JEMALLOC_MUTEX_INIT_CB) \
1352 && !defined(JEMALLOC_ZONE) && !defined(_WIN32) && \
1353 !defined(__native_client__))
1354 /* LinuxThreads' pthread_atfork() allocates. */
1355 if (pthread_atfork(jemalloc_prefork, jemalloc_postfork_parent,
1356 jemalloc_postfork_child) != 0) {
1357 malloc_write("<jemalloc>: Error in pthread_atfork()\n");
1358 if (opt_abort) {
1359 abort();
1360 }
1361 return true;
1362 }
1363#endif
1364
1365 if (background_thread_boot0()) {
1366 return true;
1367 }
1368
1369 return false;
1370}
1371
1372static unsigned
1373malloc_narenas_default(void) {

Callers 1

malloc_init_hardFunction · 0.85

Calls 4

malloc_ncpusFunction · 0.85
malloc_writeFunction · 0.85
abortClass · 0.85
background_thread_boot0Function · 0.85

Tested by

no test coverage detected