Update of /cvsroot/monetdb/MonetDB4/src/modules/plain
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11254/src/modules/plain
Modified Files:
Tag: MonetDB_4-22
sys.mx
Log Message:
Changed the way we check for and use mallinfo(): If mallinfo() returns
a struct with fields which are too small to hold the information it is
supposed to return (e.g. 32 bits on a 64-bit system), we ignore
mallinfo(). Also, we use our own struct to hold the information, so
that the rest of the software can rely on bot the presence of the
struct and the types of the fields.
This also results in one interface change: the view_gdk_memory() and
memory() functions in M4 and the memStatistics() function in M5 now
return a BAT with a wrd tail instead of int.
Index: sys.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB4/src/modules/plain/sys.mx,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -d -r1.8.2.1 -r1.8.2.2
--- sys.mx 5 Feb 2008 22:33:31 -0000 1.8.2.1
+++ sys.mx 12 Feb 2008 09:23:38 -0000 1.8.2.2
@@ -43,7 +43,7 @@
@m
.COMMAND view_gdk_cpu() : BAT[str,int] = view_gdk_cpu;
"Global cpu usage info"
-.COMMAND view_gdk_memory(): BAT[str,int] = view_gdk_mem;
+.COMMAND view_gdk_memory(): BAT[str,wrd] = view_gdk_mem;
"Global memory usage info"
.COMMAND view_gdk_io(): BAT[str,int] = view_gdk_io;
"Global IO activityinfo"
@@ -448,7 +448,7 @@
PROC cpu() : bat[str,int] { RETURN view_gdk_cpu();}
ADDHELP("cpu", "boncz", "Mar 22 1998", "Global cpu usage info", "sys");
- PROC memory() : bat[str,int] { RETURN view_gdk_memory();}
+ PROC memory() : bat[str,wrd] { RETURN view_gdk_memory();}
ADDHELP("memory", "boncz", "Mar 22 1998", "Global memory usage
info","sys");
PROC io() : bat[str,int] { RETURN view_gdk_io();}
@@ -1363,14 +1363,13 @@
int
view_gdk_mem(BAT **retval)
{
-/* 64bit: should return a [str,wrd] bat, but then again, mallinfo returns ints
*/
- struct mallinfo m;
+ struct Mallinfo m;
BAT *b;
- int i;
+ wrd i;
m = MT_mallinfo();
- *retval = b = BATnew(TYPE_str, TYPE_int, 32);
+ *retval = b = BATnew(TYPE_str, TYPE_wrd, 32);
if (b == 0)
return GDK_FAIL;
@@ -1523,7 +1522,7 @@
{
lng buns = 0, hhsh = 0, thsh = 0, hind = 0, tind = 0, head = 0, tail =
0, tot = 0, n = 0, sz;
BAT *bn = BATnew(TYPE_str, TYPE_lng, 2 * BBPsize);
- struct mallinfo m;
+ struct Mallinfo m;
char buf[1024];
bat i;
@@ -1595,7 +1594,7 @@
/* how much *used* bytes in heap? */
m = MT_mallinfo();
sz = (size_t) (m.usmblks + m.uordblks + m.hblkhd);
- BUNins(bn, "_tot/malloc", &tot, FALSE);
+ BUNins(bn, "_tot/malloc", &sz, FALSE);
/* measure actual heap size, includes wasted fragmented space and anon
mmap space used by malloc() */
sz = GDKvm_heapsize();
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins