Changeset: 1161f24990d1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1161f24990d1
Modified Files:
        MonetDB/src/gdk/gdk_batop.mx
        MonetDB/src/gdk/gdk_relop.mx
Branch: Oct2010
Log Message:

more protection against potential division by zero
in case GDKnr_threads is not properly initialized by GDKinit(),
e.g., in case of embedded servers (?);
see also bug 2701 at
http://bugs.monetdb.org/show_bug.cgi?id=2701


diffs (24 lines):

diff -r 3a52819b4635 -r 1161f24990d1 MonetDB/src/gdk/gdk_batop.mx
--- a/MonetDB/src/gdk/gdk_batop.mx      Sun Nov 28 11:28:54 2010 +0100
+++ b/MonetDB/src/gdk/gdk_batop.mx      Sun Nov 28 12:24:04 2010 +0100
@@ -1229,7 +1229,7 @@
                                && b->batPersistence == PERSISTENT
                                && (size_t) ATOMsize(b->ttype) > sizeof(BUN) / 4
                                && estimate < batcnt / 100
-                               && batcnt * (ATOMsize(b->ttype) + 2 * 
sizeof(BUN)) < (GDK_mem_maxsize / 2) /* MT_npages() * MT_pagesize() / 
GDKnr_threads */ ) {
+                               && batcnt * (ATOMsize(b->ttype) + 2 * 
sizeof(BUN)) < (GDK_mem_maxsize / 2) /* MT_npages() * MT_pagesize() / 
(GDKnr_threads ? GDKnr_threads : 1) */ ) {
                        /* Build a hash-table on the fly for equi-select on 
persistent BAT
                         * if tail-type is large (wide) and selectivity is low 
and BAT + hash-table fit in memory */
                        ALGODEBUG THRprintf(GDKout, "#BAT_select_(b=%s): 
BAT_hashselect(b=%s, bn=%s, tl); (building hash-table on the fly)\n", 
BATgetId(b), BATgetId(b), BATgetId(bn));
diff -r 3a52819b4635 -r 1161f24990d1 MonetDB/src/gdk/gdk_relop.mx
--- a/MonetDB/src/gdk/gdk_relop.mx      Sun Nov 28 11:28:54 2010 +0100
+++ b/MonetDB/src/gdk/gdk_relop.mx      Sun Nov 28 12:24:04 2010 +0100
@@ -1267,7 +1267,7 @@
 static BAT *
 batjoin(BAT *l, BAT *r, BUN estimate, bit swap)
 {
-       size_t lsize, rsize, mem_size = MT_npages() * MT_pagesize() / 
GDKnr_threads;
+       size_t lsize, rsize, mem_size = MT_npages() * MT_pagesize() / 
(GDKnr_threads ? GDKnr_threads : 1);
        BUN i, lcount, rcount;
        bit lfetch, rfetch, must_hash;
        lng logr, logl;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to