Changeset: 9c77dafe336a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9c77dafe336a
Modified Files:
        sql/server/rel_optimize_sel.c
Branch: manti
Log Message:

merged from default


diffs (truncated from 1657 to 300 lines):

diff --git a/buildtools/coverity_model.c b/buildtools/coverity_model.c
--- a/buildtools/coverity_model.c
+++ b/buildtools/coverity_model.c
@@ -124,7 +124,7 @@ GDKmmap(const char *path, int mode, size
 }
 
 gdk_return
-GDKmunmap(void *p, int mode, size_t size)
+GDKmunmap(void *p, size_t size)
 {
        int failed;
        __coverity_free__(p);
@@ -137,7 +137,7 @@ GDKmremap(const char *path, int mode, vo
 {
        void *p = GDKmmap(path, mode, new_size);
        if (p) {
-               (void) GDKmunmap(old_address, mode, old_size);
+               (void) GDKmunmap(old_address, old_size);
        }
        return p;
 }
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -312,7 +312,7 @@ size_t GDKmem_cursize(void);
 gdk_return GDKmergeidx(BAT *b, BAT **a, int n_ar);
 void *GDKmmap(const char *path, int mode, size_t len);
 int GDKms(void);
-gdk_return GDKmunmap(void *addr, int mode, size_t len);
+gdk_return GDKmunmap(void *addr, size_t len);
 int GDKnr_threads;
 void GDKprepareExit(void);
 void GDKprintinfo(void);
@@ -363,7 +363,7 @@ gdk_return HEAP_initialize(Heap *heap, s
 var_t HEAP_malloc(BAT *b, size_t nbytes);
 gdk_return HEAPalloc(Heap *h, size_t nitems, size_t itemsize);
 void HEAPdecref(Heap *h, bool remove);
-gdk_return HEAPextend(Heap *h, size_t size, bool mayshare);
+gdk_return HEAPextend(Heap *h, size_t size);
 void HEAPincref(Heap *h);
 size_t HEAPmemsize(const Heap *h);
 size_t HEAPvmsize(const Heap *h);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -173,16 +173,66 @@
 typedef enum gdk_return { GDK_FAIL, GDK_SUCCEED } gdk_return;
 
 /* basic GDK types */
-typedef bool msk;
-typedef int8_t bit;
-typedef int8_t bte;
-typedef int16_t sht;
-typedef int64_t lng;
-typedef uint64_t ulng;
+typedef bool msk;              /* one bit Boolean */
+typedef int8_t bit;            /* three-value Boolean (8 bits) */
+typedef int8_t bte;            /* 8 bit signed integer */
+typedef int16_t sht;           /* 16 bit signed integer */
+/* standard type int is used for 32 bit signed integer */
+typedef int64_t lng;           /* 64 bit signed integer */
+typedef uint64_t ulng;         /* 64 bit unsigned integer */
 #ifdef HAVE_HGE
-typedef int128_t hge;
-typedef uint128_t uhge;
+typedef int128_t hge;          /* 128 bit signed integer */
+typedef uint128_t uhge;                /* 128 bit unsigned integer */
 #endif
+typedef int bat;               /* Index into BBP */
+typedef void *ptr;             /* generic pointer */
+typedef float flt;             /* 32 bit floating point */
+typedef double dbl;            /* 64 bit floating point */
+typedef char *str;             /* null terminated UTF-8 string */
+typedef size_t oid;            /* object identifier */
+typedef oid var_t;             /* type used for heap index of var-sized BAT */
+typedef oid BUN;               /* BUN position */
+
+/* The types `oid`, `BUN` and `var_t` are all defined as `size_t`, but
+ * they serve different purposes.  `oid` is the *logical* row number of
+ * a BAT; `BUN` is the *physical* row number of a BAT and is therefore
+ * also used for the total number of rows and the potential capacity of
+ * a BAT; `var_t` is an *offset* into the var-size heap (vheap).  The
+ * difference between the *logical* and *physical* row number is the
+ * value of the head sequence base (`hseqbase`) of the BAT. */
+
+typedef union {
+       uint32_t align;         /* force alignment, only used for equality */
+       uint8_t quad[4] __attribute__((__nonstring__));
+} inet4;                       /* IPv4 internet address */
+
+typedef union {
+#ifdef HAVE_HGE
+       uint128_t align;        /* force alignment, only used for equality */
+#else
+       uint64_t align[2];      /* force alignment, not otherwise used */
+#endif
+       uint8_t hex[16] __attribute__((__nonstring__));
+} inet6;                       /* IPv6 internet address */
+
+#define UUID_SIZE      16      /* size of a UUID */
+#define UUID_STRLEN    36      /* length of string representation */
+
+typedef union {
+#ifdef HAVE_HGE
+       uint128_t h;            /* force alignment, only used for equality */
+#else
+       uint64_t l[2];          /* force alignment, not otherwise used */
+#endif
+       uint8_t u[UUID_SIZE] __attribute__((__nonstring__));
+} uuid;
+
+typedef struct {
+       size_t nitems;
+       uint8_t data[] __attribute__((__nonstring__))
+               __attribute__((__counted_by__(nitems)));
+} blob;
+gdk_export size_t blobsize(size_t nitems) __attribute__((__const__));
 
 #define SIZEOF_LNG             8
 #define LL_CONSTANT(val)       INT64_C(val)
@@ -202,61 +252,12 @@ typedef uint128_t uhge;
 #endif
 
 #define SIZEOF_OID     SIZEOF_SIZE_T
-typedef size_t oid;
 /* macro in the style of <inttypes.h> for formatting oid */
 #define PRIuOID                "zu"
 #define OIDFMT         "%" PRIuOID
 
-typedef int bat;               /* Index into BBP */
-typedef void *ptr;             /* Internal coding of types */
-
 #define SIZEOF_PTR     SIZEOF_VOID_P
-typedef float flt;
-typedef double dbl;
-typedef char *str;
-
-typedef union {
-       uint32_t align;         /* force alignment, only used for equality */
-       uint8_t quad[4] __attribute__((__nonstring__));
-} inet4;
-
-typedef union {
-#ifdef HAVE_HGE
-       uint128_t align;        /* force alignment, only used for equality */
-#else
-       uint64_t align[2];      /* force alignment, not otherwise used */
-#endif
-       uint8_t hex[16] __attribute__((__nonstring__));
-} inet6;
-
-#define UUID_SIZE      16      /* size of a UUID */
-#define UUID_STRLEN    36      /* length of string representation */
-
-typedef union {
-#ifdef HAVE_HGE
-       uint128_t h;            /* force alignment, only used for equality */
-#else
-       uint64_t l[2];          /* force alignment, not otherwise used */
-#endif
-       uint8_t u[UUID_SIZE] __attribute__((__nonstring__));
-} uuid;
-
-typedef struct {
-       size_t nitems;
-       uint8_t data[] __attribute__((__nonstring__))
-               __attribute__((__counted_by__(nitems)));
-} blob;
-gdk_export size_t blobsize(size_t nitems) __attribute__((__const__));
-
-/* The types `oid`, `BUN` and `var_t` are all defined as `size_t`, but
- * they serve different purposes.  `oid` is the *logical* row number of
- * a BAT; `BUN` is the *physical* row number of a BAT and is therefore
- * also used for the total number of rows and the potential capacity of
- * a BAT; `var_t` is an *offset* into the var-size heap (vheap).  The
- * difference between the *logical* and *physical* row number is the
- * value of the head sequence base (`hseqbase`) of the BAT. */
-
-typedef oid var_t;             /* type used for heap index of var-sized BAT */
+
 #define SIZEOF_VAR_T   SIZEOF_OID
 #define VARFMT         OIDFMT
 
@@ -266,7 +267,6 @@ typedef oid var_t;          /* type used for hea
 #define VAR_MAX                ((var_t) INT64_MAX)
 #endif
 
-typedef oid BUN;               /* BUN position */
 #define SIZEOF_BUN     SIZEOF_OID
 #define PRIuBUN                PRIuOID
 #define BUNFMT         OIDFMT
@@ -1258,7 +1258,6 @@ gdk_export void MT_cond_broadcast(MT_Con
 
 #define MMAP_READ      1024    /* region is readable (default if omitted) */
 #define MMAP_WRITE     2048    /* region may be written into */
-#define MMAP_COPY      4096    /* writable, but changes never reach file */
 
 /* in order to be sure of madvise and msync modes, pass them to mmap()
  * call as well */
@@ -1451,7 +1450,6 @@ typedef enum {
        STORE_INVALID = 0,      /* invalid value, used to indicate error */
        STORE_MEM,              /* load into GDKmalloced memory */
        STORE_MMAP,             /* mmap() into virtual memory */
-       STORE_PRIV,             /* BAT copy of copy-on-write mmap */
        STORE_NOWN,             /* memory not owned by the BAT */
 } storage_t;
 
@@ -1473,7 +1471,6 @@ typedef struct {
        bool wasempty;          /* heap was empty when last saved/created */
        bool hasfile;           /* .filename exists on disk */
        storage_t storage;      /* storage mode (mmap/malloc). */
-       storage_t newstorage;   /* new desired storage mode at re-allocation. */
        bat parentid;           /* cache id of VIEW parent bat */
 } Heap;
 
@@ -1681,7 +1678,7 @@ mskGetVal(const BAT *b, BUN p)
        return ((uint32_t *) b->theap->base)[p / 32] & (1U << (p % 32));
 }
 
-gdk_export gdk_return HEAPextend(Heap *h, size_t size, bool mayshare)
+gdk_export gdk_return HEAPextend(Heap *h, size_t size)
        __attribute__((__warn_unused_result__));
 gdk_export size_t HEAPvmsize(const Heap *h)
        __attribute__((__pure__));
@@ -3980,7 +3977,7 @@ gdk_export size_t GDK_vm_maxsize; /* max
 
 gdk_export void *GDKmmap(const char *path, int mode, size_t len)
        __attribute__((__warn_unused_result__));
-gdk_export gdk_return GDKmunmap(void *addr, int mode, size_t len);
+gdk_export gdk_return GDKmunmap(void *addr, size_t len);
 
 gdk_export size_t GDKmem_cursize(void);        /* RAM/swapmem that MonetDB has
                                         * claimed from OS */
@@ -4877,15 +4874,14 @@ gdk_export int ma_info(allocator *sa, ch
                          _res);                                        \
                _res;                                                   \
         })
-#define GDKmunmap(p, m, l)                                     \
+#define GDKmunmap(p, l)                                                \
        ({                                                      \
                void *_ptr = (p);                               \
-               int _mode = (m);                                \
                size_t _len = (l);                              \
-               gdk_return _res = GDKmunmap(_ptr, _mode, _len); \
+               gdk_return _res = GDKmunmap(_ptr, _len);        \
                TRC_DEBUG(ALLOC,                                \
-                         "GDKmunmap(%p,0x%x,%zu) -> %u\n",     \
-                         _ptr, (unsigned) _mode, _len, _res);  \
+                         "GDKmunmap(%p,%zu) -> %u\n",          \
+                         _ptr, _len, _res);                    \
                _res;                                           \
        })
 #define malloc(s)                                      \
@@ -5095,14 +5091,14 @@ GDKmmap_debug(const char *path, int mode
 }
 #define GDKmmap(p, m, l)       GDKmmap_debug((p), (m), (l))
 static inline gdk_return
-GDKmunmap_debug(void *ptr, int mode, size_t len)
+GDKmunmap_debug(void *ptr, size_t len)
 {
-       gdk_return res = GDKmunmap(ptr, mode, len);
-       TRC_DEBUG(ALLOC, "GDKmunmap(%p,0x%x%zu) -> %d\n",
-                 ptr, mode, len, (int) res);
+       gdk_return res = GDKmunmap(ptr, len);
+       TRC_DEBUG(ALLOC, "GDKmunmap(%p,%zu) -> %d\n",
+                 ptr, len, (int) res);
        return res;
 }
-#define GDKmunmap(p, m, l)     GDKmunmap_debug((p), (m), (l))
+#define GDKmunmap(p, l)                GDKmunmap_debug((p), (l))
 static inline void *
 malloc_debug(size_t size)
 {
diff --git a/gdk/gdk_analytic_func.c b/gdk/gdk_analytic_func.c
--- a/gdk/gdk_analytic_func.c
+++ b/gdk/gdk_analytic_func.c
@@ -55,7 +55,7 @@ GDKrebuild_segment_tree(oid ncount, oid 
        if (total_size > st->size) {
                total_size = (((total_size) + 1023) & ~1023); /* align to a 
multiple of 1024 bytes */
                st->free = st->size;
-               if (HEAPextend(st, total_size, true) != GDK_SUCCEED)
+               if (HEAPextend(st, total_size) != GDK_SUCCEED)
                        return GDK_FAIL;
                *segment_tree = st->base;
                *levels_offset = (oid*)(st->base + next_tree_size); /* levels 
offset will be next to the segment tree */
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -441,7 +441,7 @@ BATextend(BAT *b, BUN newcap)
        if (b->theap->base) {
                TRC_DEBUG(HEAP, "HEAPgrow in BATextend %s %zu %zu\n",
                          b->theap->filename, b->theap->size, theap_size);
-               rc = HEAPgrow(&b->theap, theap_size, b->batRestricted == 
BAT_READ);
+               rc = HEAPgrow(&b->theap, theap_size);
                if (rc == GDK_SUCCEED)
                        b->batCapacity = newcap;
        } else {
@@ -854,7 +854,7 @@ COLcopy2(BAT *b, int tt, bool writable, 
                                        algo = "share vheap, memcpy heap";
                                }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to