Bernhard Kölbl (@besentv) commented about dlls/kernelbase/memory.c:
numa_nodes[0].cpu_mask = 1;
numa_nodes[0].valid = TRUE; max_node = 0;
TRACE_(numa)("NUMA fallback single: mask=0x%llx procs=%u\n", (unsigned long long)numa_nodes[0].cpu_mask, (unsigned)popcount_ulongptr(numa_nodes[0].cpu_mask));
- }
- else if (numa_contig && max_node > 0)
- {
/* Remap each node to a contiguous block of bits in ascending order */
ULONG_PTR new_masks[64] = {0}; unsigned int bit_offset = 0; BOOL ok = TRUE;
for (i = 0; i <= max_node; i++) if (numa_nodes[i].valid)
{
unsigned int cnt = popcount_ulongptr(numa_nodes[i].cpu_mask);
if (!cnt || bit_offset + cnt > sizeof(ULONG_PTR)*8) { ok = FALSE; break; }
new_masks[i] = (((ULONG_PTR)1 << cnt) - 1) << bit_offset;
TRACE_(numa)("NUMA remap: node=%lu raw=0x%llx cnt=%u -> contig=0x%llx base=%u\n",
(unsigned long)i, (unsigned long long)numa_nodes[i].cpu_mask, cnt,
(unsigned long long)new_masks[i], bit_offset);
Why all these casts, instead of using the correct format?