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

Function pages_boot

app/redis-6.2.6/deps/jemalloc/src/pages.c:561–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559}
560
561bool
562pages_boot(void) {
563 os_page = os_page_detect();
564 if (os_page > PAGE) {
565 malloc_write("<jemalloc>: Unsupported system page size\n");
566 if (opt_abort) {
567 abort();
568 }
569 return true;
570 }
571
572#ifndef _WIN32
573 mmap_flags = MAP_PRIVATE | MAP_ANON;
574#endif
575
576#ifdef JEMALLOC_SYSCTL_VM_OVERCOMMIT
577 os_overcommits = os_overcommits_sysctl();
578#elif defined(JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY)
579 os_overcommits = os_overcommits_proc();
580# ifdef MAP_NORESERVE
581 if (os_overcommits) {
582 mmap_flags |= MAP_NORESERVE;
583 }
584# endif
585#else
586 os_overcommits = false;
587#endif
588
589 init_thp_state();
590
591 /* Detect lazy purge runtime support. */
592 if (pages_can_purge_lazy) {
593 bool committed = false;
594 void *madv_free_page = os_pages_map(NULL, PAGE, PAGE, &committed);
595 if (madv_free_page == NULL) {
596 return true;
597 }
598 assert(pages_can_purge_lazy_runtime);
599 if (pages_purge_lazy(madv_free_page, PAGE)) {
600 pages_can_purge_lazy_runtime = false;
601 }
602 os_pages_unmap(madv_free_page, PAGE);
603 }
604
605 return false;
606}

Callers 1

Calls 8

os_page_detectFunction · 0.85
malloc_writeFunction · 0.85
abortClass · 0.85
os_overcommits_sysctlFunction · 0.85
os_overcommits_procFunction · 0.85
init_thp_stateFunction · 0.85
os_pages_mapFunction · 0.85
pages_purge_lazyFunction · 0.85

Tested by

no test coverage detected