Changeset: 56933b240877 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/56933b240877
Modified Files:
gdk/gdk_storage.c
Branch: Jul2021
Log Message:
When loading an empty bat, initialize the heaps instead of loading them.
The heaps are empty, so we don't need to load anything, but we do need
to, at some point, initialize them.
diffs (25 lines):
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -888,7 +888,9 @@ BATload_intern(bat bid, bool lock)
/* LOAD bun heap */
if (b->ttype != TYPE_void) {
b->theap->storage = b->theap->newstorage = STORE_INVALID;
- if (HEAPload(b->theap, b->theap->filename, NULL,
b->batRestricted == BAT_READ) != GDK_SUCCEED) {
+ if ((b->batCount == 0 ?
+ HEAPalloc(b->theap, b->batCapacity, b->twidth,
ATOMsize(b->ttype)) :
+ HEAPload(b->theap, b->theap->filename, NULL,
b->batRestricted == BAT_READ)) != GDK_SUCCEED) {
HEAPfree(b->theap, false);
return NULL;
}
@@ -905,7 +907,9 @@ BATload_intern(bat bid, bool lock)
/* LOAD tail heap */
if (ATOMvarsized(b->ttype)) {
b->tvheap->storage = b->tvheap->newstorage = STORE_INVALID;
- if (HEAPload(b->tvheap, nme, "theap", b->batRestricted ==
BAT_READ) != GDK_SUCCEED) {
+ if ((b->tvheap->free == 0 ?
+ ATOMheap(b->ttype, b->tvheap, b->batCapacity) :
+ HEAPload(b->tvheap, nme, "theap", b->batRestricted ==
BAT_READ)) != GDK_SUCCEED) {
HEAPfree(b->theap, false);
HEAPfree(b->tvheap, false);
return NULL;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]