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

Modified Files:
        pftijah.mx 
Log Message:
propagated changes of Monday Mar 02 2009
from the Feb2009 branch to the development trunk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/03/02 - jflokstra: modules/pftijah/pftijah.mx,1.197.2.8
- patch two possible bat memory leaks in pf 2 tijah node translation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/pftijah.mx,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -d -r1.213 -r1.214
--- pftijah.mx  26 Feb 2009 10:40:57 -0000      1.213
+++ pftijah.mx  2 Mar 2009 21:26:21 -0000       1.214
@@ -4611,7 +4611,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) {
@@ -4646,7 +4647,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 {
@@ -4655,8 +4657,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 ) {
@@ -4682,7 +4687,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