We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a8d91c commit 97c94b7Copy full SHA for 97c94b7
mmtk_support.c
@@ -16,6 +16,10 @@
16
#include "vm_sync.h"
17
#include "stdatomic.h"
18
19
+#ifdef __APPLE__
20
+#include <sys/sysctl.h>
21
+#endif
22
+
23
#ifdef __GNUC__
24
#define PREFETCH(addr, write_p) __builtin_prefetch(addr, write_p)
25
#define EXPECT(expr, val) __builtin_expect(expr, val)
@@ -218,8 +222,7 @@ rb_mmtk_system_physical_memory(void)
218
222
rb_bug("failed to get system physical memory size");
219
223
}
220
224
return (size_t) physical_pages * (size_t) page_size;
221
-#elif __APPLE__
- #include <sys/sysctl.h>
225
+#elif defined(__APPLE__)
226
int mib[2];
227
mib[0] = CTL_HW;
228
mib[1] = HW_MEMSIZE; // total physical memory
0 commit comments