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

Modified Files:
      Tag: Feb2009
        pftijah.mx 
Log Message:
- patch two possible bat memory leaks in pf 2 tijah node translation



U pftijah.mx
Index: pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/pftijah.mx,v
retrieving revision 1.197.2.7
retrieving revision 1.197.2.8
diff -u -d -r1.197.2.7 -r1.197.2.8
--- pftijah.mx  5 Feb 2009 14:48:35 -0000       1.197.2.7
+++ pftijah.mx  2 Mar 2009 15:17:59 -0000       1.197.2.8
@@ -4433,7 +4433,8 @@
            /* make it a switch */
            if ( rangeBAT[myindex] == NULL ) {
 
-             BAT* docs_in_cont = 
BATselect(BATmirror(doc_loaded),&container,&container);
+             BAT* dlmirror = BATmirror(doc_loaded);
+             BAT* docs_in_cont = BATselect(dlmirror,&container,&container);
               BATiter docs_in_conti = bat_iterator(docs_in_cont);
              BUN p_dic,q_dic;
              BATloop(docs_in_cont, p_dic, q_dic) {
@@ -4468,7 +4469,8 @@
                    } else {
                        doc_end = oid_nil;
                    }
-                   BAT* ds = 
BATselect(BATmirror(doc_pfpre),(ptr)&doc_start,(ptr)&doc_end);
+                   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 {
@@ -4477,8 +4479,11 @@
                           return GDK_FAIL;
                        }
                    }
+                   /* BBPunfix(BBPcacheid(ds)); FAILS */
                } {
-               } } }
+               } } 
+               BBPunfix(BBPcacheid(docs_in_cont));
+             }
                if ( rangeBAT[myindex] ) {
                    BUN range_bun = BUNfnd(rangeBAT[myindex],&pfpre);
                    if ( range_bun != BUN_NONE ) {
@@ -4504,7 +4509,12 @@
         }
        GDKfree(rangeBAT);
 
-       *res = BATmirror(BATmark(BATmirror(*res), 0));
+       BAT *r1 = BATmirror(*res);
+       BAT *r2 = BATmark(r1, 0);
+       *res    = BATmirror(r2);
+
+       BBPunfix(BBPcacheid(r1));
+       /* BBPunfix(BBPcacheid(r2)); FAILS */
 
        /* */
        if ( debug ) 


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