Update of /cvsroot/monetdb/pathfinder/modules/pftijah
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30641

Modified Files:
        pftijah.mx 
Log Message:
- experiments in solving memory leaks



U pftijah.mx
Index: pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/pftijah.mx,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -d -r1.214 -r1.215
--- pftijah.mx  2 Mar 2009 21:26:21 -0000       1.214
+++ pftijah.mx  3 Mar 2009 14:00:38 -0000       1.215
@@ -4179,6 +4179,7 @@
 #include <pathfinder.h>
 
 #include "pftijah.h"
+#include "pftijah_util.h"
 
 #include "termdb.h"
 
@@ -4650,19 +4651,19 @@
                    BAT* dpfpm = BATmirror(doc_pfpre);
                    BAT* ds = BATselect(dpfpm,(ptr)&doc_start,(ptr)&doc_end);
                    if ( rangeBAT[myindex] == NULL ) {
-                       rangeBAT[myindex] = BATsetaccess(ds, BAT_WRITE);
-                   } else {
-                       if ( !BATins(rangeBAT[myindex],ds,1) ) {
-                          stream_printf(GDKout,"CMDpf2tijah_node: BATins in 
rangeBAT fails.\n");
-                          return GDK_FAIL;
-                       }
+                       rangeBAT[myindex] = BATnew(TYPE_oid, TYPE_oid, 
BATcount(ds));
+                       // BBPfix(BBPcacheid(rangeBAT[myindex]));
+                   } 
+                   if ( !BATins(rangeBAT[myindex],ds,1) ) {
+                      stream_printf(GDKout,"CMDpf2tijah_node: BATins in 
rangeBAT fails.\n");
+                      return GDK_FAIL;
                    }
-                   /* BBPunfix(BBPcacheid(ds)); FAILS */
+                   BBPunfix(BBPcacheid(ds));
                } {
                } } 
                BBPunfix(BBPcacheid(docs_in_cont));
              }
-               if ( rangeBAT[myindex] ) {
+             if ( rangeBAT[myindex] ) {
                    BUN range_bun = BUNfnd(rangeBAT[myindex],&pfpre);
                    if ( range_bun != BUN_NONE ) {
                        /* found the tijah index value */
@@ -4674,9 +4675,9 @@
                        if ( debug ) stream_printf(GDKout,"* pf2tijah_index: 
pre(%...@0) @ cont(%d) = NOT INDEXED.\n", pfpre, container);
                    }
                    
-               } else {
+             } else {
                        if ( debug ) stream_printf(GDKout,"* pf2tijah_index: 
pre(%...@0) @ cont(%d) = NOT INDEXED.\n", pfpre, container);
-               }
+             }
        }
        /* cleanup BAT's */
        for(int i=0; i<nDocs; i++) {
@@ -4689,11 +4690,9 @@
 
        BAT *r1 = BATmirror(*res);
        BAT *r2 = BATmark(r1, 0);
+       BBPunfix(BBPcacheid(*res));
        *res    = BATmirror(r2);
 
-       BBPunfix(BBPcacheid(r1));
-       /* BBPunfix(BBPcacheid(r2)); FAILS */
-
        /* */
        if ( debug ) 
            BATprintf(GDKout,*res);


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to