Below is the list of changes that have just been committed into a local
6.0 repository of hakan. When hakan does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-11-28 13:09:37+01:00, hakank@au0012. +1 -0
Changed FreeBSD and Mac physical RAM size detection to work with
RAM size > 2GB.
storage/falcon/Configuration.cpp@stripped, 2007-11-28 13:09:32+01:00, hakank@au0012. +13 -3
Changed FreeBSD and Mac physical RAM size detection to work with
RAM size > 2GB.
diff -Nrup a/storage/falcon/Configuration.cpp b/storage/falcon/Configuration.cpp
--- a/storage/falcon/Configuration.cpp 2007-11-27 19:28:06 +01:00
+++ b/storage/falcon/Configuration.cpp 2007-11-28 13:09:32 +01:00
@@ -332,12 +332,22 @@ uint64 Configuration::getPhysicalMemory(
size_t len = sizeof availableMem;
static int mib[2] = {CTL_HW, HW_USERMEM};
sysctl(mib, 2, &availableMem, &len, NULL, 0);
-
+
+ // For physical RAM size on Apple we are using HW_MEMSIZE key,
+ // because HW_PHYSMEM does not report correct RAM sizes above 2GB.
+#if defined(__APPLE__)
+ uint64_t physMem = 0;
+ mib[1] = HW_MEMSIZE;
+#endif
+
+#if defined(__FreeBSD__)
size_t physMem = 0;
+ mib[1] = HW_PHYSMEM
+#endif
+
len = sizeof physMem;
- mib[1] = HW_PHYSMEM;
sysctl(mib, 2, &physMem, &len, NULL, 0);
-
+
availableMemory = (uint64) availableMem;
totalMemory = (uint64) physMem;