Changeset: 6b61b20385ad for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6b61b20385ad
Modified Files:
        gdk/gdk_strimps.c
Branch: strimps_update
Log Message:

Increase reference count when manipulating the strimp heap


diffs (24 lines):

diff --git a/gdk/gdk_strimps.c b/gdk/gdk_strimps.c
--- a/gdk/gdk_strimps.c
+++ b/gdk/gdk_strimps.c
@@ -880,9 +880,11 @@ STRMPcreate(BAT *b, BAT *s)
                return GDK_SUCCEED;
        }
 
+       /* At this point pb->tstrimps should be a valid strimp heap. */
+       assert(pb->tstrimps);
        MT_thread_setalgorithm("create strimp index");
        r = pb->tstrimps;
-       assert(r);
+       STRMPincref(r);
        dh = (uint64_t *)r->bitstrings_base + b->hseqbase;
        canditer_init(&ci, b, s);
 
@@ -904,6 +906,7 @@ STRMPcreate(BAT *b, BAT *s)
                persistStrimp(pb);
        }
        MT_lock_unset(&b->batIdxLock);
+       STRMPdecref(r, false);
 
        TRC_DEBUG(ACCELERATOR, "strimp creation took " LLFMT " usec\n", 
GDKusec()-t0);
        return GDK_SUCCEED;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to