Skip to content

Commit 97c94b7

Browse files
committed
Fix include and conditional compilation
1 parent 6a8d91c commit 97c94b7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: mmtk_support.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
#include "vm_sync.h"
1717
#include "stdatomic.h"
1818

19+
#ifdef __APPLE__
20+
#include <sys/sysctl.h>
21+
#endif
22+
1923
#ifdef __GNUC__
2024
#define PREFETCH(addr, write_p) __builtin_prefetch(addr, write_p)
2125
#define EXPECT(expr, val) __builtin_expect(expr, val)
@@ -218,8 +222,7 @@ rb_mmtk_system_physical_memory(void)
218222
rb_bug("failed to get system physical memory size");
219223
}
220224
return (size_t) physical_pages * (size_t) page_size;
221-
#elif __APPLE__
222-
#include <sys/sysctl.h>
225+
#elif defined(__APPLE__)
223226
int mib[2];
224227
mib[0] = CTL_HW;
225228
mib[1] = HW_MEMSIZE; // total physical memory

0 commit comments

Comments
 (0)