Changeset: 8fd0d65d327f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8fd0d65d327f
Modified Files:
        MonetDB.spec
        sql/backends/monet5/sql_statement.c
        sql/server/rel_optimize_sel.c
        sql/server/rel_select.c
        sql/server/rel_unnest.c
Branch: default
Log Message:

merged with Dec2025


diffs (truncated from 1848 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -60,7 +60,7 @@
 # derivatives (CentOS, Scientific Linux), the geos library is not
 # available.  However, the geos library is available in the Extra
 # Packages for Enterprise Linux (EPEL).
-%if %{fedpkgs} && (0%{?rhel} != 7) && (0%{?rhel} != 8)
+%if %{fedpkgs} && (0%{?rhel} != 7) && (0%{?rhel} != 8) && (0%{?rhel} != 9)
 # By default create the MonetDB-geom package on Fedora and RHEL 7
 %bcond_without geos
 %endif
@@ -462,26 +462,27 @@ developer.
 
 %files client-tests
 %defattr(-,root,root)
-%{_bindir}/ODBCStmtAttr
+%{_bindir}/arraytest
+%{_bindir}/backrefencode
+%{_bindir}/bincopydata
+%{_bindir}/malsample.pl
+%{_bindir}/murltest
+%{_bindir}/odbcconnect
 %{_bindir}/ODBCgetInfo
 %{_bindir}/ODBCmetadata
+%{_bindir}/odbcsample1
+%{_bindir}/ODBCStmtAttr
 %{_bindir}/ODBCtester
-%{_bindir}/arraytest
-%{_bindir}/bincopydata
-%{_bindir}/murltest
-%{_bindir}/odbcconnect
-%{_bindir}/odbcsample1
 %{_bindir}/sample0
 %{_bindir}/sample1
 %{_bindir}/sample4
 %{_bindir}/shutdowntest
 %{_bindir}/smack00
 %{_bindir}/smack01
+%{_bindir}/sqlsample.php
+%{_bindir}/sqlsample.pl
 %{_bindir}/streamcat
 %{_bindir}/testcondvar
-%{_bindir}/malsample.pl
-%{_bindir}/sqlsample.php
-%{_bindir}/sqlsample.pl
 %endif
 
 %if %{with geos}
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
@@ -304,7 +304,6 @@ ATOMIC_FLAG GDKlocklistlock;
 ATOMIC_TYPE GDKlocksleepcnt;
 void GDKlockstatistics(int);
 void *GDKmalloc(size_t size) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__alloc_size__(1))) 
__attribute__((__warn_unused_result__));
-size_t GDKmallocated(const void *s);
 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) 
__attribute__((__warn_unused_result__));
diff --git a/debian/monetdb-client-testing.install 
b/debian/monetdb-client-testing.install
--- a/debian/monetdb-client-testing.install
+++ b/debian/monetdb-client-testing.install
@@ -1,20 +1,21 @@
-debian/tmp/usr/bin/ODBCStmtAttr usr/bin
+debian/tmp/usr/bin/arraytest usr/bin
+debian/tmp/usr/bin/backrefencode usr/bin
+debian/tmp/usr/bin/bincopydata usr/bin
+debian/tmp/usr/bin/malsample.pl usr/bin
+debian/tmp/usr/bin/murltest usr/bin
+debian/tmp/usr/bin/odbcconnect usr/bin
 debian/tmp/usr/bin/ODBCgetInfo usr/bin
 debian/tmp/usr/bin/ODBCmetadata usr/bin
+debian/tmp/usr/bin/odbcsample1 usr/bin
+debian/tmp/usr/bin/ODBCStmtAttr usr/bin
 debian/tmp/usr/bin/ODBCtester usr/bin
-debian/tmp/usr/bin/arraytest usr/bin
-debian/tmp/usr/bin/bincopydata usr/bin
-debian/tmp/usr/bin/murltest usr/bin
-debian/tmp/usr/bin/odbcconnect usr/bin
-debian/tmp/usr/bin/odbcsample1 usr/bin
 debian/tmp/usr/bin/sample0 usr/bin
 debian/tmp/usr/bin/sample1 usr/bin
 debian/tmp/usr/bin/sample4 usr/bin
 debian/tmp/usr/bin/shutdowntest usr/bin
 debian/tmp/usr/bin/smack00 usr/bin
 debian/tmp/usr/bin/smack01 usr/bin
+debian/tmp/usr/bin/sqlsample.php usr/bin
+debian/tmp/usr/bin/sqlsample.pl usr/bin
 debian/tmp/usr/bin/streamcat usr/bin
 debian/tmp/usr/bin/testcondvar usr/bin
-debian/tmp/usr/bin/malsample.pl usr/bin
-debian/tmp/usr/bin/sqlsample.php usr/bin
-debian/tmp/usr/bin/sqlsample.pl usr/bin
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2005,8 +2005,8 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3
        if (BATtvoid(l)) {
                /* l->ttype == TYPE_void && is_oid_nil(l->tseqbase) is
                 * handled by selectjoin */
-               assert(!is_oid_nil(l->tseqbase));
-               canditer_init(&llci, NULL, l);
+               if (!is_oid_nil(l->tseqbase))
+                       canditer_init(&llci, NULL, l);
                lvals = NULL;
        } else {
                lvals = li.base;                              /* non NULL */
diff --git a/gdk/gdk_system_private.h b/gdk/gdk_system_private.h
--- a/gdk/gdk_system_private.h
+++ b/gdk/gdk_system_private.h
@@ -52,11 +52,10 @@ struct allocator {
        struct allocator *pa;
        size_t size;     /* size of the allocator in terms of blocks */
        size_t nr;       /* number of blocks allocated */
-       char **blks;
-       char *first_blk;
+       void **blks;
+       void *first_blk;
        size_t used;     /* memory used in last block */
        size_t usedmem;  /* total used memory */
-       size_t blk_size; /* size of the last allocated block */
        size_t objects;  /* number of objects */
        size_t inuse;    /* number of objects in use*/
        size_t free_obj_hits; /* number of object reuse*/
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -1685,691 +1685,6 @@ GDKprintinforegister(void (*func)(void))
 #define DEBUG_SPACE    16
 #endif
 
-#define MA_NUM_BLOCKS 64
-#define MA_BLOCK_SIZE (128*1024)
-#define MA_HEADER_SIZE (2*(sizeof(size_t)))
-#define CANARY_VALUE ((size_t)0xDEADBEEFDEADBEEF)
-#define round16(sz) ((sz+15)&~15)
-#define round_block_size(sz) ((sz + (MA_BLOCK_SIZE - 1))&~(MA_BLOCK_SIZE - 1))
-
-#define COND_LOCK_ALLOCATOR(a)                 \
-       bool __alloc_locked = false;            \
-       if ((a)->use_lock) {                    \
-               MT_lock_set(&(a)->lock);        \
-               __alloc_locked = true;          \
-       }
-
-#define COND_UNLOCK_ALLOCATOR(a)               \
-       if (__alloc_locked) {                   \
-               MT_lock_unset(&(a)->lock);      \
-       }
-
-
-typedef struct freed_t {
-       size_t sz;
-       struct freed_t *n;
-} freed_t;
-
-
-static inline size_t
-ma_get_blk_idx(allocator *sa, void *blk, size_t offset)
-{
-       for (size_t i = offset; i < sa->nr; i++) {
-               if (sa->blks[i] == blk)
-                       return i;
-       }
-       assert(0 && "allocator block not found");
-       if (sa->eb.enabled) {
-               eb_error(&sa->eb, "allocator block not found", 1000);
-       }
-       return sa->nr;
-}
-
-
-static void
-ma_free_obj(allocator *sa, void *obj, size_t sz)
-{
-       //size_t i;
-
-       //char *obj_start = (char *) obj;
-       //char *obj_end = obj_start + sz;
-
-       //// find the block this object belongs to
-       //for(i = 0; i < sa->nr; i++) {
-       //      char * blk_start = (char *) sa->blks[i];
-       //      char * blk_end = blk_start + MA_BLOCK_SIZE;
-       //      if ((obj_start >= blk_start) && (obj_end <= blk_end))
-       //              break;
-       //}
-       //assert (i < sa->nr);
-       freed_t *f = obj;
-       f->sz = sz;
-       f->n = sa->freelist;
-       sa->freelist = f;
-       if (sa->inuse > 0)
-               sa->inuse -= 1;
-}
-
-/*
- * Put regular blks of size MA_BLOCK_SIZE on freelist_blks
- * all others are GDKfree
- */
-static void
-ma_free_blk_memory(allocator *sa, void *blk)
-{
-       if (!sa->pa) {
-               // all blks are GDKmalloc
-               size_t sz = GDKmallocated(blk) - (MALLOC_EXTRA_SPACE + 
DEBUG_SPACE);
-               assert(sz > 0);
-               if (sz == MA_BLOCK_SIZE) {
-                       freed_t *f = blk;
-                       f->sz = sz;
-                       f->n = sa->freelist_blks;
-                       sa->freelist_blks = f;
-               } else {
-                       GDKfree(blk);
-                       sa->usedmem -= sz;
-               }
-       }
-}
-
-
-static void
-ma_free_blk(allocator *sa, void *blk)
-{
-       size_t i = ma_get_blk_idx(sa, blk, 0);
-       if (i < sa->nr) {
-               if (sa->pa)
-                       ma_free_blk(sa->pa, blk);
-               else
-                       ma_free_blk_memory(sa, blk);
-               // compact
-               for (; i < sa->nr-1; i++)
-                       sa->blks[i] = sa->blks[i+1];
-               sa->nr--;
-       }
-}
-
-
-/*
- * Return first slot that will fit the size
- */
-static void *
-ma_use_freed_obj(allocator *sa, size_t sz)
-{
-       freed_t *prev = NULL;
-       int cntr = 0;
-       int MAX_ITERATIONS = 100;
-       COND_LOCK_ALLOCATOR(sa);
-       freed_t *curr = sa->freelist;
-       while(curr && (cntr < MAX_ITERATIONS)) {
-               if (sz <= curr->sz) {
-                       if (prev) {
-                               prev->n = curr->n;
-                       } else {
-                               sa->freelist = curr->n;
-                       }
-                       sa->free_obj_hits += 1;
-                       sa->inuse += 1;
-                       COND_UNLOCK_ALLOCATOR(sa);
-                       return curr;
-               } else {
-                       prev = curr;
-                       curr = curr->n;
-               }
-               cntr += 1;
-       }
-       COND_UNLOCK_ALLOCATOR(sa);
-       return NULL;
-}
-
-static int ma_double_num_blks(allocator *sa);
-
-
-/*
- * Free blocks are maintained at top level
- */
-static void *
-ma_use_freed_blk(allocator *sa, size_t sz)
-{
-       if (sa->pa)
-               return ma_use_freed_blk(sa->pa, sz);
-       COND_LOCK_ALLOCATOR(sa);
-       if (sa->freelist_blks && (sz == MA_BLOCK_SIZE)) {
-               if (sa->nr >= sa->size && ma_double_num_blks(sa) < 0) {
-                       COND_UNLOCK_ALLOCATOR(sa);
-                       if (sa->eb.enabled)
-                               eb_error(&sa->eb, "out of memory", 1000);
-                       return NULL;
-               }
-               freed_t *f = sa->freelist_blks;
-               sa->freelist_blks = f->n;
-               sa->blk_size = MA_BLOCK_SIZE;
-               sa->used = MA_BLOCK_SIZE;
-               sa->blks[sa->nr] = (char*)f;
-               sa->nr ++;
-               sa->free_blk_hits += 1;
-               COND_UNLOCK_ALLOCATOR(sa);
-               return f;
-       }
-       COND_UNLOCK_ALLOCATOR(sa);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to