Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/foundation/system_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static cbm_system_info_t detect_system_bsd(void) {
info.total_cores = nprocs > 0 ? (int)nprocs : 1;
info.perf_cores = info.total_cores;

#if defined(__OpenBSD__)
#if defined(__OpenBSD__) || defined(__FreeBSD__)
int mib[2] = {CTL_HW, HW_PHYSMEM};
#else
int mib[2] = {CTL_HW, HW_PHYSMEM64};
Expand Down
8 changes: 8 additions & 0 deletions tests/test_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ TEST(platform_default_workers_env_unset) {
PASS();
}

TEST(platform_system_info) {
cbm_system_info_t info = cbm_system_info();
ASSERT_GT(info.total_cores, 0);
ASSERT_GT(info.total_ram, 0);
PASS();
}

/* ── cgroup-aware detection (Linux only) ─────────────────────────── */

#ifdef __linux__
Expand Down Expand Up @@ -316,6 +323,7 @@ SUITE(platform) {
RUN_TEST(platform_default_workers_env_override);
RUN_TEST(platform_default_workers_env_invalid);
RUN_TEST(platform_default_workers_env_unset);
RUN_TEST(platform_system_info);
#ifdef __linux__
RUN_TEST(cgroup_v2_cpu_quota);
RUN_TEST(cgroup_v2_cpu_quota_rounds_up);
Expand Down
Loading