Hi all,
I would suggest a small correction for computing available memory
on FreeBSD:
--- platform.c.old Sat Aug 24 22:16:03 2002
+++ platform.c Tue Jan 6 17:00:31 2004
@@ -589,8 +589,7 @@
#endif
len = sizeof(struct vmtotal);
sysctl(mib, 2, &ourmem, &len, NULL, 0);
- ourmem.t_free /= 1024*1024; /* calculate in mb */
- ss->amem=(int)usermem-(ourpagesize*ourmem.t_free);
+ ss->amem=(int)ourpagesize*ourmem.t_free/(1024*1024);
ss->cpu =(int)ourcpu;
ss->ncpu=(int)ncpu;
/* Fill out hostname */
Could somebody verify that it's OK?
Thanks,
Petr
I would suggest a small correction for computing available memory
on FreeBSD:
--- platform.c.old Sat Aug 24 22:16:03 2002
+++ platform.c Tue Jan 6 17:00:31 2004
@@ -589,8 +589,7 @@
#endif
len = sizeof(struct vmtotal);
sysctl(mib, 2, &ourmem, &len, NULL, 0);
- ourmem.t_free /= 1024*1024; /* calculate in mb */
- ss->amem=(int)usermem-(ourpagesize*ourmem.t_free);
+ ss->amem=(int)ourpagesize*ourmem.t_free/(1024*1024);
ss->cpu =(int)ourcpu;
ss->ncpu=(int)ncpu;
/* Fill out hostname */
Could somebody verify that it's OK?
Thanks,
Petr