Changeset: 6be99f70d2db for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6be99f70d2db
Modified Files:
        gdk/gdk.h
        gdk/gdk_aggr.c
        gdk/gdk_align.c
        gdk/gdk_bat.c
        gdk/gdk_bbp.c
        gdk/gdk_group.c
        gdk/gdk_hash.c
        gdk/gdk_imprints.c
        gdk/gdk_join.c
        gdk/gdk_orderidx.c
        gdk/gdk_select.c
        gdk/gdk_storage.c
        gdk/gdk_unique.c
        monetdb5/mal/mal_profiler.c
        sql/storage/bat/bat_storage.c
Branch: jit
Log Message:

Merge with default


diffs (truncated from 454 to 300 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -391,22 +391,18 @@
 #define GDKisalnum(c)  isalnum((int) (unsigned char) (c))
 #define GDKisdigit(c)  (((unsigned char) (c)) >= '0' && ((unsigned char) (c)) 
<= '9')
 
-#define GDKPROP                6       /* use one spare! */
-#define MONETHOME      "MONETHOME"
 #ifndef NATIVE_WIN32
 #define BATDIR         "bat"
 #define DELDIR         "bat/DELETE_ME"
 #define BAKDIR         "bat/BACKUP"
 #define SUBDIR         "bat/BACKUP/SUBCOMMIT"
 #define LEFTDIR                "bat/LEFTOVERS"
-#define HCDIR          "bat/HC"
 #else
 #define BATDIR         "bat"
 #define DELDIR         "bat\\DELETE_ME"
 #define BAKDIR         "bat\\BACKUP"
 #define SUBDIR         "bat\\BACKUP\\SUBCOMMIT"
 #define LEFTDIR                "bat\\LEFTOVERS"
-#define HCDIR          "bat\\HC"
 #endif
 
 #ifdef MAXPATHLEN
@@ -637,12 +633,13 @@ typedef enum { GDK_FAIL, GDK_SUCCEED } g
 
 /* Heap storage modes */
 typedef enum {
-       STORE_MEM     = 0,              /* load into GDKmalloced memory */
-       STORE_MMAP    = 1,              /* mmap() into virtual memory */
-       STORE_PRIV    = 2,              /* BAT copy of copy-on-write mmap */
-    STORE_CMEM    = 3,      /* Indicates the value is stored in regular C 
memory rather than GDK memory.*/
-    STORE_NOWN    = 4,      /* Indicates that the bat does not own the chunk 
of memory and is not in charge of freeing it.*/
-    STORE_MMAPABS = 5,      /* mmap() into virtual memory from an absolute 
path (not part of dbfarm) */
+       STORE_MEM     = 0,      /* load into GDKmalloced memory */
+       STORE_MMAP    = 1,      /* mmap() into virtual memory */
+       STORE_PRIV    = 2,      /* BAT copy of copy-on-write mmap */
+       STORE_CMEM    = 3,      /* load into malloc (not GDKmalloc) memory*/
+       STORE_NOWN    = 4,      /* memory not owned by the BAT */
+       STORE_MMAPABS = 5,      /* mmap() into virtual memory from an
+                                * absolute path (not part of dbfarm) */
        STORE_INVALID           /* invalid value, used to indicate error */
 } storage_t;
 
@@ -653,8 +650,8 @@ typedef struct {
        str filename;           /* file containing image of the heap */
 
        unsigned int copied:1,  /* a copy of an existing map. */
-                     hashash:1,/* the string heap contains hash values */
-                     forcemap:1;  /* force STORE_MMAP even if heap exists */
+               hashash:1,      /* the string heap contains hash values */
+               forcemap:1;     /* force STORE_MMAP even if heap exists */
        storage_t storage;      /* storage mode (mmap/malloc). */
        storage_t newstorage;   /* new desired storage mode at re-allocation. */
        bte dirty;              /* specific heap dirty marker */
@@ -896,8 +893,6 @@ typedef struct BATiter {
        oid tvid;
 } BATiter;
 
-typedef int (*GDKfcn) ();
-
 /* macros's to hide complexity of BAT structure */
 #define batPersistence S.persistence
 #define batCopiedtodisk        S.copiedtodisk
@@ -2726,7 +2721,7 @@ gdk_export void ALIGNsetT(BAT *b1, BAT *
 #define ALIGNapp(x,y,f,e)      do {if (!(f)) 
VIEWchk(x,y,BAT_READ,e);(x)->talign=0; } while (0)
 
 #define BAThrestricted(b) ((b)->batRestricted)
-#define BATtrestricted(b) (VIEWtparent(b) ? 
BBP_cache(-VIEWtparent(b))->batRestricted : (b)->batRestricted)
+#define BATtrestricted(b) (VIEWtparent(b) ? 
BBP_cache(VIEWtparent(b))->batRestricted : (b)->batRestricted)
 
 /* The batRestricted field indicates whether a BAT is readonly.
  * we have modes: BAT_WRITE  = all permitted
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -2284,9 +2284,9 @@ BATminmax(BAT *b, void *aggr,
        BATiter bi;
 
        if ((VIEWtparent(b) == 0 ||
-            BATcount(b) == BATcount(BBPdescriptor(-VIEWtparent(b)))) &&
+            BATcount(b) == BATcount(BBPdescriptor(VIEWtparent(b)))) &&
            BATcheckimprints(b)) {
-               Imprints *imprints = VIEWtparent(b) ? 
BBPdescriptor(-VIEWtparent(b))->timprints : b->timprints;
+               Imprints *imprints = VIEWtparent(b) ? 
BBPdescriptor(VIEWtparent(b))->timprints : b->timprints;
                pos = oid_nil;
                if (minmax == do_groupmin) {
                        /* find first non-empty bin */
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -179,7 +179,7 @@ VIEWcreate_(oid seq, BAT *b, int slice_v
        if (bn == NULL)
                return NULL;
 
-       tp = -VIEWtparent(b);
+       tp = VIEWtparent(b);
        if ((tp == 0 && b->ttype != TYPE_void) || b->theap.copied)
                tp = b->batCacheid;
        assert(b->ttype != TYPE_void || !tp);
@@ -215,7 +215,7 @@ VIEWcreate_(oid seq, BAT *b, int slice_v
 
        /* correct values after copy of head and tail info */
        if (tp)
-               bn->theap.parentid = -tp;
+               bn->theap.parentid = tp;
        BATinit_idents(bn);
        /* Some bits must be copied individually. */
        bn->batDirty = BATdirty(b);
@@ -312,7 +312,7 @@ static void
 VIEWunlink(BAT *b)
 {
        if (b) {
-               bat tp = -VIEWtparent(b);
+               bat tp = VIEWtparent(b);
                bat vtp = VIEWvtparent(b);
                BAT *tpb = NULL;
                BAT *vtpb = NULL;
@@ -361,7 +361,7 @@ VIEWreset(BAT *b)
        if (b == NULL)
                return GDK_FAIL;
        assert(b->batCacheid > 0);
-       tp = -VIEWtparent(b);
+       tp = VIEWtparent(b);
        tvp = VIEWvtparent(b);
        if (tp || tvp) {
                BUN cnt;
@@ -440,7 +440,7 @@ VIEWreset(BAT *b)
                        b->tvheap->parentid = b->batCacheid;
                }
 
-               if (-v->theap.parentid == b->batCacheid) {
+               if (v->theap.parentid == b->batCacheid) {
                        assert(tp == 0);
                        assert(b->batSharecnt > 0);
                        BBPunshare(b->batCacheid);
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -629,7 +629,7 @@ COLcopy(BAT *b, int tt, int writable, in
                        bunstocopy = cnt;
                } else if (isVIEW(b)) {
                        /* extra checks needed for views */
-                       bat tp = -VIEWtparent(b);
+                       bat tp = VIEWtparent(b);
 
                        if (tp != 0 && BATcapacity(BBP_cache(tp)) > cnt + cnt)
                                /* reduced slice view: do not copy too
@@ -1376,7 +1376,7 @@ BATkey(BAT *b, int flag)
        if (flag && VIEWtparent(b)) {
                /* if a view is key, then so is the parent if the two
                 * are aligned */
-               BAT *bp = BBP_cache(-VIEWtparent(b));
+               BAT *bp = BBP_cache(VIEWtparent(b));
                if (BATcount(b) == BATcount(bp) &&
                    ATOMtype(BATttype(b)) == ATOMtype(BATttype(bp)) &&
                    !BATtkey(bp) &&
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1469,7 +1469,7 @@ BBPexit(void)
                                                 * VIEWdestroy doesn't
                                                 * (and can't here due
                                                 * to locks) do it */
-                                               bat tp = -VIEWtparent(b);
+                                               bat tp = VIEWtparent(b);
                                                bat vtp = VIEWvtparent(b);
                                                if (tp) {
                                                        
BBP_cache(tp)->batSharecnt--;
@@ -2385,7 +2385,7 @@ incref(bat i, int logical, int lock)
                tp = tvp = 0;
                refs = ++BBP_lrefs(i);
        } else {
-               tp = -b->theap.parentid;
+               tp = b->theap.parentid;
                assert(tp >= 0);
                tvp = b->tvheap == 0 || b->tvheap->parentid == i ? 0 : 
b->tvheap->parentid;
                refs = ++BBP_refs(i);
@@ -2492,11 +2492,11 @@ decref(bat i, int logical, int releaseSh
                        GDKerror("BBPdecref: %s does not have pointer 
fixes.\n", BBPname(i));
                        assert(0);
                } else {
-                       assert(b == NULL || b->theap.parentid == 0 || 
BBP_refs(-b->theap.parentid) > 0);
+                       assert(b == NULL || b->theap.parentid == 0 || 
BBP_refs(b->theap.parentid) > 0);
                        assert(b == NULL || b->tvheap == NULL || 
b->tvheap->parentid == 0 || BBP_refs(b->tvheap->parentid) > 0);
                        refs = --BBP_refs(i);
                        if (b && refs == 0) {
-                               if ((tp = -b->theap.parentid) != 0)
+                               if ((tp = b->theap.parentid) != 0)
                                        b->theap.base = (char *) (b->theap.base 
- BBP_cache(tp)->theap.base);
                                /* if a view shared the hash with its
                                 * parent, indicate this, but only if
@@ -2759,7 +2759,7 @@ BBPsave(BAT *b)
 static void
 BBPdestroy(BAT *b)
 {
-       bat tp = -b->theap.parentid;
+       bat tp = b->theap.parentid;
        bat vtp = VIEWvtparent(b);
 
        if (isVIEW(b)) {        /* a physical view */
@@ -2793,7 +2793,7 @@ BBPdestroy(BAT *b)
 static gdk_return
 BBPfree(BAT *b, const char *calledFrom)
 {
-       bat bid = b->batCacheid, tp = -VIEWtparent(b), vtp = VIEWvtparent(b);
+       bat bid = b->batCacheid, tp = VIEWtparent(b), vtp = VIEWvtparent(b);
        gdk_return ret;
 
        assert(bid > 0);
diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -757,7 +757,7 @@ BATgroup_internal(BAT **groups, BAT **ex
                   (b->batPersistence == PERSISTENT &&
                    BAThash(b, 0) == GDK_SUCCEED)
 #ifndef DISABLE_PARENT_HASH
-                  || ((parent = -VIEWtparent(b)) != 0 &&
+                  || ((parent = VIEWtparent(b)) != 0 &&
                       BATcheckhash(BBPdescriptor(parent)))
 #endif
                ) {
@@ -777,7 +777,7 @@ BATgroup_internal(BAT **groups, BAT **ex
                                  h ? BATgetId(h) : "NULL", h ? BATcount(h) : 0,
                                  subsorted);
 #ifndef DISABLE_PARENT_HASH
-               if (b->thash == NULL && (parent = -VIEWtparent(b)) != 0) {
+               if (b->thash == NULL && (parent = VIEWtparent(b)) != 0) {
                        /* b is a view on another bat (b2 for now).
                         * calculate the bounds [lo, hi) in the parent
                         * that b uses */
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -575,7 +575,7 @@ HASHdestroy(BAT *b)
                                  BBP_physical(b->batCacheid),
                                  b->batCacheid > 0 ? "thash" : "hhash");
                } else if (b->thash) {
-                       bat p = -VIEWtparent(b);
+                       bat p = VIEWtparent(b);
                        BAT *hp = NULL;
 
                        if (p)
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -189,7 +189,7 @@ BATcheckimprints(BAT *b)
 
        if (VIEWtparent(b)) {
                assert(b->timprints == NULL);
-               b = BBPdescriptor(-VIEWtparent(b));
+               b = BBPdescriptor(VIEWtparent(b));
        }
 
        MT_lock_set(&GDKimprintsLock(b->batCacheid));
@@ -295,7 +295,7 @@ BATimprints(BAT *b)
        assert(b->timprints == NULL);
 
        if (VIEWtparent(b)) {
-               bat p = -VIEWtparent(b);
+               bat p = VIEWtparent(b);
                o = b;
                b = BATdescriptor(p);
                if (BATcheckimprints(b)) {
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2698,7 +2698,7 @@ hashjoin(BAT *r1, BAT *r2, BAT *l, BAT *
        rl = BUNfirst(r);
 #ifndef DISABLE_PARENT_HASH
        if (VIEWtparent(r)) {
-               BAT *b = BBPdescriptor(-VIEWtparent(r));
+               BAT *b = BBPdescriptor(VIEWtparent(r));
                if (b->batPersistence == PERSISTENT || BATcheckhash(b)) {
                        /* only use parent's hash if it is persistent
                         * or already has a hash */
@@ -3946,7 +3946,7 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
        mem_size = GDK_mem_maxsize / (GDKnr_threads ? GDKnr_threads : 1);
 
 #ifndef DISABLE_PARENT_HASH
-       lparent = -VIEWtparent(l);
+       lparent = VIEWtparent(l);
        if (lparent) {
                lpcount = BATcount(BBPdescriptor(lparent));
                lhash = BATcheckhash(l) || BATcheckhash(BBPdescriptor(lparent));
@@ -3957,7 +3957,7 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
                lhash = BATcheckhash(l);
        }
 #ifndef DISABLE_PARENT_HASH
-       rparent = -VIEWtparent(r);
+       rparent = VIEWtparent(r);
        if (rparent) {
                rpcount = BATcount(BBPdescriptor(rparent));
                rhash = BATcheckhash(r) || BATcheckhash(BBPdescriptor(rparent));
diff --git a/gdk/gdk_orderidx.c b/gdk/gdk_orderidx.c
--- a/gdk/gdk_orderidx.c
+++ b/gdk/gdk_orderidx.c
@@ -392,7 +392,7 @@ GDKmergeidx(BAT *b, BAT**a, int n_ar)
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to