| 1452 | _Atomic(size_t) _mi_numa_node_count; // = 0 // cache the node count |
| 1453 | |
| 1454 | size_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 | |
| 1471 | int _mi_os_numa_node_get(mi_os_tld_t* tld) { |
| 1472 | MI_UNUSED(tld); |
nothing calls this directly
no test coverage detected