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

Function pages_boot

deps/memkind/src/jemalloc/src/pages.c:393–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391#endif
392
393bool
394pages_boot(void) {
395 os_page = os_page_detect();
396 if (os_page > PAGE) {
397 malloc_write("<jemalloc>: Unsupported system page size\n");
398 if (opt_abort) {
399 abort();
400 }
401 return true;
402 }
403
404#ifndef _WIN32
405 mmap_flags = MAP_PRIVATE | MAP_ANON;
406#endif
407
408#ifdef JEMALLOC_SYSCTL_VM_OVERCOMMIT
409 os_overcommits = os_overcommits_sysctl();
410#elif defined(JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY)
411 os_overcommits = os_overcommits_proc();
412# ifdef MAP_NORESERVE
413 if (os_overcommits) {
414 mmap_flags |= MAP_NORESERVE;
415 }
416# endif
417#else
418 os_overcommits = false;
419#endif
420
421 return false;
422}

Callers 1

Calls 4

os_page_detectFunction · 0.70
malloc_writeFunction · 0.70
os_overcommits_sysctlFunction · 0.70
os_overcommits_procFunction · 0.70

Tested by

no test coverage detected