Changeset: 39c9a59d11e4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=39c9a59d11e4
Modified Files:
MonetDB5/src/optimizer/opt_mitosis.mx
Branch: Oct2010
Log Message:
re-arragned type casts to prevent potential overflows
diffs (22 lines):
diff -r 4b3e30f2208b -r 39c9a59d11e4 MonetDB5/src/optimizer/opt_mitosis.mx
--- a/MonetDB5/src/optimizer/opt_mitosis.mx Thu Dec 23 21:32:34 2010 +0100
+++ b/MonetDB5/src/optimizer/opt_mitosis.mx Sat Dec 25 10:25:17 2010 +0100
@@ -148,15 +148,15 @@
/* ensure that GDKnr_threads partitions fit into main memory */
r = (BUN) (monet_memory / typewidth / threads);
if (rowcnt > r)
- pieces = MAX ( (int)(rowcnt / r + 1) , threads);
+ pieces = (int) MAX ( (rowcnt / r + 1) , (wrd) threads );
else
/* exploit parallelism, but ensure minimal partition size to
limit overhead */
if (rowcnt > MINPARTCNT)
- pieces = MIN ( (int)(rowcnt / MINPARTCNT) , threads);
+ pieces = (int) MIN ( (rowcnt / MINPARTCNT) , (wrd)
threads);
/* when testing, split also small BATs, but avoid empty pieces
*/
FORCEMITODEBUG
if (pieces < threads)
- pieces = MIN ( threads , (int)rowcnt );
+ pieces = (int) MIN ( (wrd) threads , rowcnt );
/* prevent plan explosion */
if (pieces > MAXSLICES)
pieces = MAXSLICES;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list