Update of /cvsroot/monetdb/MonetDB5/src/modules/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25372

Modified Files:
        recycle.mx 
Log Message:
added recycle.monitor(0/1) function (also get*Policy).


Index: recycle.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/recycle.mx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- recycle.mx  11 Mar 2008 10:50:50 -0000      1.13
+++ recycle.mx  11 Mar 2008 23:46:18 -0000      1.14
@@ -47,11 +47,16 @@
 4- RETAIN_VOL: volumetric cost model (time x size )
 5- RETAIN_ADAP: adaptive temporal";
 
+command getRetainPolicy():int
+address RECYCLEgetRetain;
 
 pattern setReusePolicy(p:int...):void
 address RECYCLEsetReuse
 comment "Set recycler reuse policy";
 
+command getReusePolicy():int
+address RECYCLEgetReuse;
+
 pattern setCachePolicy(p:int...):void
 address RECYCLEsetCache
 comment "Set recycler cache policy:
@@ -62,10 +67,16 @@
 4- RCACHE_MEMCRD: reduce the storage overhead 
 optional arguments are [ instruction-, [memory -]] limit";
 
+command getCachePolicy():int
+address RECYCLEgetCache;
 
 command shutdown():void
 address RECYCLEshutdownWrap
 comment "Clear the recycle cache";
+
+command monitor(f:int):void
+address RECYCLEmonitor
+comment "start/stop the monitoring (printing) of the recycler info (storage 
size used and number of statements retained)"
 @h
 #ifndef _RECYCLE_
 #define _RECYCLE_
@@ -89,7 +100,11 @@
 recycle_export str RECYCLEsetRetain(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 recycle_export str RECYCLEsetReuse(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 recycle_export str RECYCLEsetCache(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
+recycle_export str RECYCLEgetRetain(int *p);
+recycle_export str RECYCLEgetReuse(int *p);
+recycle_export str RECYCLEgetCache(int *p);
 recycle_export str RECYCLEshutdownWrap(int *ret);
+recycle_export str RECYCLEmonitor(int *d, int *p);
 
 #endif
 @-
@@ -191,7 +206,6 @@
        }
        if(p->argc >3)
                recycleAlpha = 1.0/  *(int*) getArgReference(stk, p,4);
-       (void)retainPolicy;
        return MAL_SUCCEED;
 }
 
@@ -200,7 +214,6 @@
 {
        (void) mb;
        reusePolicy = * (int*) getArgReference(stk, p,1);
-       (void)reusePolicy;
        return MAL_SUCCEED;
 }
 
@@ -213,9 +226,30 @@
                recycleCacheLimit = * (int*) getArgReference(stk, p,2);
        if( rcachePolicy && p->argc >= 3)
                recycleMemory= * (int*) getArgReference(stk, p,2);
-       (void)recycleCacheLimit;
        return MAL_SUCCEED;
 }
+
+str 
+RECYCLEgetRetain(int *p)
+{
+       *p = retainPolicy;
+       return MAL_SUCCEED;
+}
+
+str 
+RECYCLEgetReuse(int *p)
+{
+       *p = reusePolicy;
+       return MAL_SUCCEED;
+}
+
+str 
+RECYCLEgetCache(int *p)
+{
+       *p = rcachePolicy;
+       return MAL_SUCCEED;
+}
+
 @-
 At the end of the session we have to cleanup the recycle cache.
 @c
@@ -225,4 +259,11 @@
        RECYCLEshutdown();
        return MAL_SUCCEED;
 }
+str 
+RECYCLEmonitor(int *ret, int *p)
+{
+       (void) ret;
+       monitorRecycler = *p;
+       return MAL_SUCCEED;
+}
 @}


-------------------------------------------------------------------------
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

Reply via email to