Update of /cvsroot/monetdb/MonetDB/src/gdk
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10786/src/gdk

Modified Files:
      Tag: GDK-2
        gdk_storage.mx 
Log Message:
make sure we do not overwrite heap information during BATsave


Index: gdk_storage.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_storage.mx,v
retrieving revision 1.128.2.6
retrieving revision 1.128.2.7
diff -u -d -r1.128.2.6 -r1.128.2.7
--- gdk_storage.mx      15 Aug 2007 13:07:55 -0000      1.128.2.6
+++ gdk_storage.mx      19 Aug 2007 12:19:13 -0000      1.128.2.7
@@ -514,6 +514,15 @@
        b->H = &bs.H;
        b->T = &bs.T;
 
+       if (b->hheap) {
+               b->hheap = (Heap *) GDKmalloc(sizeof(Heap));
+               *b->hheap = *bd->hheap;
+       }
+       if (b->theap) {
+               b->theap = (Heap *) GDKmalloc(sizeof(Heap));
+               *b->theap = *bd->theap;
+       }
+
        /* start saving data */
        nme = BBP_physical(b->batCacheid);
        if (b->batCopiedtodisk == 0 || b->batDirty || b->batDirtybuns) {
@@ -543,6 +552,11 @@
                        IODEBUG THRprintf(GDKout, "#BATsavedesc(%s,free=" SZFMT 
"," SZFMT ") = %d\n", nme, b->H->heap.free, b->T->heap.free, err);
                }
 
+       if (b->hheap)
+               GDKfree(b->hheap);
+       if (b->theap)
+               GDKfree(b->theap);
+
        if (err == 0) {
                bd->batCopiedtodisk = 1;
                DESCclean(bd);
@@ -719,6 +733,7 @@
                        GDKwarning("BATdelete(%s): descriptor\n", BATgetId(b));
                }
        }
+       assert(!b->H->heap.base || !b->T->heap.base || b->H->heap.base != 
b->T->heap.base);
        if (b->batCopiedtodisk || (b->H->heap.storage & STORE_MMAP)) {
                if (b->htype != TYPE_void && HEAPdelete(&b->H->heap, o, "head") 
&&
                    b->batCopiedtodisk)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to