Changeset: 607b6feb80a8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/607b6feb80a8
Modified Files:
        gdk/gdk.h
        gdk/gdk_atoms.c
        gdk/gdk_private.h
        gdk/gdk_string.c
        monetdb5/modules/mal/pcre.c
        monetdb5/modules/mal/pp_mat.c
Branch: default
Log Message:

Remove atom type fstr.


diffs (163 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -208,7 +208,6 @@ enum {
        TYPE_inet4,
        TYPE_inet6,
        TYPE_str,
-       TYPE_fstr,
        TYPE_blob,
        TYPE_any = 255,         /* limit types to <255! */
 };
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -2426,23 +2426,6 @@ atomDesc BATatoms[MAXATOMS] = {
                .atomLen = (size_t (*)(const void *)) strLen,
                .atomHeap = strHeap,
        },
-       [TYPE_fstr] = {
-               .name = "fstr",
-               .storage = TYPE_str,
-               .linear = true,
-               .size = sizeof(var_t),
-               .atomNull = (void *) str_nil,
-               .atomFromStr = (ssize_t (*)(allocator *ma, const char *, size_t 
*, void **, bool)) strFromStr,
-               .atomToStr = (ssize_t (*)(allocator *ma, char **, size_t *, 
const void *, bool)) strToStr,
-               .atomRead = (void *(*)(allocator *ma, void *, size_t *, stream 
*, size_t)) strRead,
-               .atomWrite = (gdk_return (*)(const void *, stream *, size_t)) 
strWrite,
-               .atomCmp = (int (*)(const void *, const void *)) strCmp,
-               .atomEqual = (bool (*)(const void *, const void *)) strEq,
-               .atomHash = (BUN (*)(const void *)) strHash,
-               .atomPut = fstrPut,
-               .atomLen = (size_t (*)(const void *)) strLen,
-               .atomHeap = strHeap,
-       },
        [TYPE_blob] = {
                .name = "blob",
                .storage = TYPE_blob,
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -255,8 +255,6 @@ var_t strLocate(Heap *h, const char *v)
        __attribute__((__visibility__("hidden")));
 var_t strPut(BAT *b, var_t *dst, const void *v)
        __attribute__((__visibility__("hidden")));
-var_t fstrPut(BAT *b, var_t *dst, const void *v)
-       __attribute__((__visibility__("hidden")));
 char *strRead(allocator *, str a, size_t *dstlen, stream *s, size_t cnt)
        __attribute__((__visibility__("hidden")));
 ssize_t strToStr(allocator *, char **restrict dst, size_t *restrict len, const 
char *restrict src, bool external)
diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -10158,78 +10158,6 @@ BATasciify(BAT *b, BAT *s)
        return NULL;
 }
 
-var_t
-fstrPut(BAT *b, var_t *dst, const void *V)
-{
-       const char *v = V;
-       Heap *h = b->tvheap;
-       size_t pos, len = strlen(v) + 1;
-
-       if (h->free == 0) {
-               if (h->size < GDK_STRHASHTABLE * sizeof(var_t) + BATTINY * 
GDK_VARALIGN) {
-                       if (HEAPgrow(&b->tvheap, GDK_STRHASHTABLE * 
sizeof(var_t) + BATTINY * GDK_VARALIGN, true) != GDK_SUCCEED) {
-                               return (var_t) -1;
-                       }
-                       h = b->tvheap;
-               }
-               h->free = GDK_STRHASHTABLE * sizeof(var_t);
-               memset(h->base, 0, h->free);
-               h->dirty = true;
-               b->tascii = true;
-       }
-
-#ifndef NDEBUG
-       if (!checkUTF8(v, NULL)) {
-               GDKerror("incorrectly encoded UTF-8\n");
-               return (var_t) -1;
-       }
-#endif
-
-       /* check heap for space (limited to a certain maximum after
-        * which nils are inserted) */
-       if (h->free + len >= h->size) {
-               size_t newsize = MAX(h->size, 4096);
-
-               /* double the heap size until we have enough space */
-               do {
-                       if (newsize < 4 * 1024 * 1024)
-                               newsize <<= 1;
-                       else
-                               newsize += 4 * 1024 * 1024;
-               } while (newsize <= h->free + len);
-
-               assert(newsize);
-
-               if (h->free + len >= (size_t) VAR_MAX) {
-                       GDKerror("string heap gets larger than %zuGiB.\n", 
(size_t) VAR_MAX >> 30);
-                       return (var_t) -1;
-               }
-               TRC_DEBUG(HEAP, "HEAPextend in strPut %s %zu %zu\n", 
h->filename, h->size, newsize);
-               if (HEAPgrow(&b->tvheap, newsize, true) != GDK_SUCCEED) {
-                       return (var_t) -1;
-               }
-               h = b->tvheap;
-       }
-
-       /* insert string */
-       pos = h->free;
-       *dst = (var_t) pos;
-       memcpy(h->base + pos, v, len);
-       h->free += len;
-       h->dirty = true;
-
-       if (b->tascii && !strNil(v)) {
-               for (const uint8_t *p = (const uint8_t *) v; *p; p++) {
-                       if (*p >= 128) {
-                               b->tascii = false;
-                               break;
-                       }
-               }
-       }
-       return *dst;
-}
-
-
 #ifdef HAVE_OPENSSL
 
 #include <openssl/evp.h>
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -489,7 +489,7 @@ pcre_replace_bat(BAT **res, BAT *origin_
                throw(MAL, "regexp.rematch", MAL_MALLOC_FAIL);
        }
 
-       tmpbat = COLnew(origin_strs->hseqbase, TYPE_fstr, BATcount(origin_strs),
+       tmpbat = COLnew(origin_strs->hseqbase, TYPE_str, BATcount(origin_strs),
                                        TRANSIENT);
 
        /* the buffer for all destination strings is allocated only once,
@@ -538,7 +538,6 @@ pcre_replace_bat(BAT **res, BAT *origin_
                else /* buffer is enlarged */
                        init_size = max_dest_size;
        }
-       tmpbat->ttype = TYPE_str;
        tmpbat->tsorted = tmpbat->trevsorted = false;
        tmpbat->tkey = false;
        tmpbat->tascii = false;
diff --git a/monetdb5/modules/mal/pp_mat.c b/monetdb5/modules/mal/pp_mat.c
--- a/monetdb5/modules/mal/pp_mat.c
+++ b/monetdb5/modules/mal/pp_mat.c
@@ -310,7 +310,6 @@ PARTpartition(Client ctx, bat *pos, cons
                        }                                                       
                                        \
                        if (BATcount(mt->bat[i]) < (curpos[i]+lp[i]))           
                                \
                                BATsetcount(mt->bat[i], curpos[i]+lp[i]);       
                                        \
-                       /*mt->bat[i]->ttype = TYPE_fstr;*/ \
                }                                                               
                                        \
                if (err == NULL) {                                              
                                        \
                        BATiter di = bat_iterator(d); \
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to