MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / detect_system_macos

Function detect_system_macos

src/foundation/system_info.c:71–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static cbm_system_info_t detect_system_macos(void) {
72 cbm_system_info_t info;
73 memset(&info, 0, sizeof(info));
74
75 info.total_cores = sysctl_int("hw.ncpu", DEFAULT_CORES);
76 info.perf_cores = sysctl_int("hw.perflevel0.physicalcpu", info.total_cores);
77
78 /* If perflevel sysctls fail (Intel Mac), perf = total */
79 int eff = sysctl_int("hw.perflevel1.physicalcpu", 0);
80 if (info.perf_cores + eff > info.total_cores) {
81 info.perf_cores = info.total_cores;
82 }
83
84 info.total_ram = sysctl_size("hw.memsize", 0);
85 return info;
86}
87
88#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
89

Callers 1

cbm_system_infoFunction · 0.85

Calls 2

sysctl_intFunction · 0.85
sysctl_sizeFunction · 0.85

Tested by

no test coverage detected