Changeset: 40594bfd57a5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=40594bfd57a5
Modified Files:
Branch: Jun2010
Log Message:
Merge heads.
diffs (35 lines):
diff -r 9665844e6545 -r 40594bfd57a5 MonetDB/src/gdk/gdk_system.mx
--- a/MonetDB/src/gdk/gdk_system.mx Wed Jun 30 10:22:29 2010 +0200
+++ b/MonetDB/src/gdk/gdk_system.mx Wed Jun 30 10:27:35 2010 +0200
@@ -372,22 +372,20 @@
# if defined(HAVE_SYSCONF) && defined(_SC_PHYS_PAGES)
_MT_npages = sysconf(_SC_PHYS_PAGES);
# else
-# if defined(HAVE_GETRLIMIT) && defined(RLIMIT_RSS)
+# if defined(HAVE_SYS_SYSCTL_H) && defined(HW_MEMSIZE)
{
- struct rlimit rl;
+ int mib[2] = { CTL_HW, HW_MEMSIZE };
+ unsigned int namelen = sizeof(mib) / sizeof(mib[0]);
+ uint64_t size;
+ size_t len = sizeof(size);
- /* Specifies the limit (in pages) of the process's resident set
- * (the number of virtual pages resident in RAM). This limit
- * only has effect in Linux 2.4.x, x < 30, and there only
- * affects calls to madvise() specifying MADV_WILLNEED */
- /* FIXME: this looks like a total wrong thing to check in any
- * case to me */
- getrlimit(RLIMIT_RSS, &rl);
- _MT_npages = rl.rlim_cur / _MT_pagesize;
+ if (sysctl(mib, namelen, &size, &len, NULL, 0) >= 0) {
+ _MT_npages = size / _MT_pagesize;
+ }
}
# else
# error "don't know how to get the amount of physical memory for your OS"
-# endif /* getrlimit */
+# endif /* sysctl */
# endif /* sysconf */
# endif /* GlobalMemoryStatus */
#endif /* GlobalMemoryStatusEx */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list