Changeset: 855086e7f52e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=855086e7f52e
Modified Files:
        gdk/gdk.h
        gdk/gdk_align.c
Branch: default
Log Message:

BATmaterializeh and BATmaterialize are deprecated.


diffs (138 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -3251,6 +3251,26 @@ gdk_export BAT *BATsample(BAT *b, BUN n)
                BATkdiff(_l, _r);                                       \
        })
 
+#define BATmaterializeh(b)                                             \
+       ({                                                              \
+               BAT *_b = (b), *_r = (r);                               \
+               HEADLESSDEBUG fprintf(stderr,                           \
+                       "#BATmaterializeh([%s,%s]#"BUNFMT") %s[%s:%d]\n", \
+                       _COL_TYPE(_b->H), _COL_TYPE(_b->T), BATcount(_b), \
+                       __func__, __FILE__, __LINE__);                  \
+               BATmaterializeh(_b);                                    \
+       })
+
+#define BATmaterialize(b)                                              \
+       ({                                                              \
+               BAT *_b = (b), *_r = (r);                               \
+               HEADLESSDEBUG fprintf(stderr,                           \
+                       "#BATmaterialize([%s,%s]#"BUNFMT") %s[%s:%d]\n", \
+                       _COL_TYPE(_b->H), _COL_TYPE(_b->T), BATcount(_b), \
+                       __func__, __FILE__, __LINE__);                  \
+               BATmaterialize(_b);                                     \
+       })
+
 #endif
 #endif
 
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -412,74 +412,77 @@ VIEWcombine(BAT *b)
  */
 
 gdk_return
-BATmaterializeh(BAT *b)
+BATmaterializet(BAT *b)
 {
-       int ht;
+       int tt;
        BUN cnt;
-       Heap head;
+       Heap tail;
        BUN p, q;
-       oid h, *x;
-       bte tshift;
+       oid t, *x;
+       bte hshift;
 
        BATcheck(b, "BATmaterialize", GDK_FAIL);
        assert(!isVIEW(b));
-       ht = b->htype;
+       tt = b->ttype;
        cnt = BATcapacity(b);
-       head = b->H->heap;
+       tail = b->T->heap;
        p = BUNfirst(b);
        q = BUNlast(b);
        assert(cnt >= q - p);
        ALGODEBUG fprintf(stderr, "#BATmaterialize(%d);\n", (int) 
b->batCacheid);
 
-       if (!BAThdense(b) || ht != TYPE_void) {
+       if (!BATtdense(b) || tt != TYPE_void) {
                /* no voids */
                return GDK_SUCCEED;
        }
-       ht = TYPE_oid;
+       tt = TYPE_oid;
 
        /* cleanup possible ACC's */
        HASHdestroy(b);
        IMPSdestroy(b);
 
-       b->H->heap.filename = NULL;
-       if (HEAPalloc(&b->H->heap, cnt, sizeof(oid)) != GDK_SUCCEED) {
-               b->H->heap = head;
+       b->T->heap.filename = NULL;
+       if (HEAPalloc(&b->T->heap, cnt, sizeof(oid)) != GDK_SUCCEED) {
+               b->T->heap = tail;
                return GDK_FAIL;
        }
 
        /* point of no return */
-       b->htype = ht;
-       tshift = b->T->shift;
+       b->ttype = tt;
+       hshift = b->H->shift;
        BATsetdims(b);
-       if (b->ttype) {
-               b->T->shift = tshift;   /* restore in case it got changed */
-               b->T->width = 1 << tshift;
+       if (b->htype) {
+               b->H->shift = hshift;   /* restore in case it got changed */
+               b->H->width = 1 << hshift;
        }
        b->batDirty = TRUE;
        b->batDirtydesc = TRUE;
-       b->H->heap.dirty = TRUE;
+       b->T->heap.dirty = TRUE;
 
        /* set the correct dense info */
-       b->hdense = TRUE;
+       b->tdense = TRUE;
 
-       /* So now generate [h..h+cnt-1] */
-       h = b->hseqbase;
-       x = (oid *) b->H->heap.base;
+       /* So now generate [t..t+cnt-1] */
+       t = b->tseqbase;
+       x = (oid *) b->T->heap.base;
        for (; p < q; p++)
-               *x++ = h++;
-       cnt = h - b->hseqbase;
+               *x++ = t++;
+       cnt = t - b->tseqbase;
        BATsetcount(b, cnt);
 
        /* cleanup the old heaps */
-       HEAPfree(&head, 0);
+       HEAPfree(&tail, 0);
        return GDK_SUCCEED;
 }
 
+#undef BATmaterializeh
+#undef BATmaterialize
+
 /* only materialize the tail */
 gdk_return
-BATmaterializet(BAT *b)
+BATmaterializeh(BAT *b)
 {
-       return BATmaterializeh(BATmirror(b));
+       return BATmaterializet(BATmirror(b));
 }
 
 gdk_return
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to