| 238 | |
| 239 | #ifdef _WIN32 |
| 240 | static cbm_system_info_t detect_system_windows(void) { |
| 241 | cbm_system_info_t info; |
| 242 | memset(&info, 0, sizeof(info)); |
| 243 | |
| 244 | SYSTEM_INFO si; |
| 245 | GetSystemInfo(&si); |
| 246 | info.total_cores = (int)si.dwNumberOfProcessors; |
| 247 | if (info.total_cores < 1) { |
| 248 | info.total_cores = SKIP_ONE; |
| 249 | } |
| 250 | info.perf_cores = info.total_cores; |
| 251 | |
| 252 | MEMORYSTATUSEX ms; |
| 253 | ms.dwLength = sizeof(ms); |
| 254 | if (GlobalMemoryStatusEx(&ms)) { |
| 255 | info.total_ram = (size_t)ms.ullTotalPhys; |
| 256 | } |
| 257 | |
| 258 | return info; |
| 259 | } |
| 260 | #endif |
| 261 | |
| 262 | /* ── Public API ──────────────────────────────────────────────────── */ |