Changeset: 1fb714e9eac6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1fb714e9eac6
Modified Files:
        gdk/gdk_string.c
        monetdb5/mal/mal_interpreter.c
        tools/merovingian/daemon/argvcmds.c
        tools/merovingian/daemon/forkmserver.c
        tools/merovingian/daemon/merovingian.c
        tools/merovingian/daemon/monetdbd.1.in
        tools/merovingian/utils/utils.c
        tools/merovingian/utils/utils.h
Branch: default
Log Message:

Merge with Oct2020 branch.


diffs (56 lines):

diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -108,8 +108,8 @@ strCleanHash(Heap *h, bool rebuild)
         * started. */
        memset(newhash, 0, sizeof(newhash));
        pos = GDK_STRHASHSIZE;
-       while (pos < h->free && pos < GDK_ELIMLIMIT) {
-               pad = GDK_VARALIGN - (pos & (GDK_VARALIGN - 1));
+       while (pos < h->free &&
+              pos + (pad = GDK_VARALIGN - (pos & (GDK_VARALIGN - 1))) < 
GDK_ELIMLIMIT) {
                if (pad < sizeof(stridx_t))
                        pad += GDK_VARALIGN;
                pos += pad + extralen;
@@ -255,7 +255,6 @@ strPut(BAT *b, var_t *dst, const void *V
 {
        const char *v = V;
        Heap *h = b->tvheap;
-       size_t elimbase = GDK_ELIMBASE(h->free);
        size_t pad;
        size_t pos, len = strLen(v);
        const size_t extralen = h->hashash ? EXTRALEN : 0;
@@ -304,19 +303,16 @@ strPut(BAT *b, var_t *dst, const void *V
        }
 
        pad = GDK_VARALIGN - (h->free & (GDK_VARALIGN - 1));
-       if (elimbase == 0) {    /* i.e. h->free < GDK_ELIMLIMIT */
+       if (GDK_ELIMBASE(h->free + pad) == 0) { /* i.e. h->free+pad < 
GDK_ELIMLIMIT */
                if (pad < sizeof(stridx_t)) {
                        /* make room for hash link */
                        pad += GDK_VARALIGN;
                }
-       } else if (extralen == 0) {     /* i.e., h->hashash == FALSE */
-               /* no VARSHIFT and no string hash value stored => no
-                * padding/alignment needed */
+       } else if (GDK_ELIMBASE(h->free) != 0) {
+               /* no extra padding needed when no hash links needed
+                * (but only when padding doesn't cross duplicate
+                * elimination boundary) */
                pad = 0;
-       } else {
-               /* pad to align on VARALIGN for VARSHIFT and/or string
-                * hash value */
-               pad &= (GDK_VARALIGN - 1);
        }
 
        /* check heap for space (limited to a certain maximum after
@@ -371,7 +367,7 @@ strPut(BAT *b, var_t *dst, const void *V
 
        /* maintain hash table */
        pos -= extralen;
-       if (elimbase == 0) {    /* small string heap: link the next pointer */
+       if (GDK_ELIMBASE(pos) == 0) {   /* small string heap: link the next 
pointer */
                /* the stridx_t next pointer directly precedes the
                 * string and optional (depending on hashash) hash
                 * value */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to