MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / _mi_os_numa_node_count_get

Function _mi_os_numa_node_count_get

3rd/mimalloc-2.0.9/src/os.c:1454–1469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1452_Atomic(size_t) _mi_numa_node_count; // = 0 // cache the node count
1453
1454size_t _mi_os_numa_node_count_get(void) {
1455 size_t count = mi_atomic_load_acquire(&_mi_numa_node_count);
1456 if (count <= 0) {
1457 long ncount = mi_option_get(mi_option_use_numa_nodes); // given explicitly?
1458 if (ncount > 0) {
1459 count = (size_t)ncount;
1460 }
1461 else {
1462 count = mi_os_numa_node_countx(); // or detect dynamically
1463 if (count == 0) count = 1;
1464 }
1465 mi_atomic_store_release(&_mi_numa_node_count, count); // save it
1466 _mi_verbose_message("using %zd numa regions\n", count);
1467 }
1468 return count;
1469}
1470
1471int _mi_os_numa_node_get(mi_os_tld_t* tld) {
1472 MI_UNUSED(tld);

Callers

nothing calls this directly

Calls 3

mi_option_getFunction · 0.85
mi_os_numa_node_countxFunction · 0.85
_mi_verbose_messageFunction · 0.85

Tested by

no test coverage detected