Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31244
Modified Files:
mal.mx mal_recycle.mx
Log Message:
move debugging info within macros.
prepare for cleanup
Index: mal_recycle.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_recycle.mx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- mal_recycle.mx 4 Mar 2008 14:52:46 -0000 1.9
+++ mal_recycle.mx 4 Mar 2008 20:14:33 -0000 1.10
@@ -69,6 +69,7 @@
mal_export str RECYCLEsetRetain(int *ret, sht *p);
mal_export str RECYCLEsetReuse(int *ret, sht *p);
mal_export str RECYCLEsetCache(int *ret, sht *p);
+mal_export str RECYCLEshutdown(int *ret);
mal_export int RECYCLEentry(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
mal_export void RECYCLEexit(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
@@ -346,12 +347,17 @@
bid = nbid;
b1= BATdescriptor(bid);
BBPkeepref(bid);
+#ifdef _DEBUG_RECYCLE_
printf("counts %d -> %d \n", bid,
(int)BATcount(b1));
+#endif
} else {
b1= BATdescriptor(bid);
b2= BATdescriptor(nbid);
-printf("counts %d -> %d %d -> %d\n", bid, (int)BATcount(b1), nbid,
(int)BATcount(b2));
+#ifdef _DEBUG_RECYCLE_
+ printf("counts %d -> %d %d ->
%d\n",
+ bid, (int)BATcount(b1),
nbid, (int)BATcount(b2));
+#endif
if( BATcount(b1) >
BATcount(b2)){
BBPreleaseref(bid);
BBPreleaseref(bid);
@@ -466,3 +472,31 @@
}
}
@}
[EMAIL PROTECTED]
+At the end of the session we have to cleanup the recycle cache.
+@
+str
+RECYLEshutdown(int *ret){
+ InstrPtr q;
+ int i,j;
+ MalBlkPtr mb;
+
+ if( recycleBlk == NULL)
+ return MAL_SUCCEED;
+
+ mal_set_lock(recycleLock,"recycle");
+ mb= recycleBlk;
+ recycleBlk= NULL;
+ mal_unset_lock(recycleLock,"recycle");
+
+ for(i=0; i< mb->stop; i++){
+ q= getInstrPtr(mb,i);
+ for(j=0; j< q->argc; j++)
+ if( isVarConstant(mb,getArg(q,j)) {
+ if( isaBatType(getArgType(mb, q,j)) )
+
BBPreleaseref(getVarConstant(mb,getArg(q,j)).val.bval));
+ }
+ }
+ freeMalBlk(mb);
+ return MAL_SUCCEED;
+}
Index: mal.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal.mx,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- mal.mx 28 Feb 2008 07:58:31 -0000 1.136
+++ mal.mx 4 Mar 2008 20:14:33 -0000 1.137
@@ -305,6 +305,7 @@
#include "mal_namespace.h" /* for initNamespace() */
#include "mal_client.h"
#include "mal_sabaoth.h"
+#include "mal_recycle.h"
MT_Lock mal_contextLock;
@-
@@ -373,6 +374,7 @@
return;
}
#if 0
+{
int reruns=0;
int freeclient=0, finishing=0, claimed=0, awaiting=0;
Client cntxt = mal_clients;
@@ -396,6 +398,7 @@
stream_printf(mal_clients->fdout,"#MALexit: server forced exit"
" %d finishing %d claimed %d waiting\n",
finishing,claimed,awaiting);
+}
#endif
@c
#if 0
-------------------------------------------------------------------------
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