Changeset: e3085bac2897 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e3085bac2897
Modified Files:
        gdk/gdk_heap.c
Branch: Dec2023
Log Message:

Do not free chunks inside a vheap.
This fixes bug #7415.

The problem is, HEAP_free is not compatible with append_varsized_bat
since the latter creates duplicate entries in the offset heap, all
referring to the same location in the vheap.


diffs (25 lines):

diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -1247,6 +1247,13 @@ HEAP_malloc(BAT *b, size_t nbytes)
 void
 HEAP_free(Heap *heap, var_t mem)
 {
+/* we cannot free pieces of the heap because we may have used
+ * append_varsized_bat to create the heap; if we did, there may be
+ * multiple locations in the offset heap that refer to the same entry in
+ * the vheap, so we cannot free any until we free all */
+       (void) heap;
+       (void) mem;
+#if 0
        HEADER *hheader = HEAP_index(heap, 0, HEADER);
        CHUNK *beforep;
        CHUNK *blockp;
@@ -1318,6 +1325,7 @@ HEAP_free(Heap *heap, var_t mem)
                 */
                hheader->head = block;
        }
+#endif
 }
 
 void
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to