Changeset: 2431255646ea for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2431255646ea
Modified Files:
        MonetDB5/src/mal/mal_interpreter.mx
Branch: default
Log Message:

Merge from Jun2010 branch: Reduce stack usage.

Using BUFSIZ is almost invariable *the wrong thing to do*.


diffs (36 lines):

diff -r 4dd1701e7f19 -r 2431255646ea MonetDB5/src/mal/mal_interpreter.mx
--- a/MonetDB5/src/mal/mal_interpreter.mx       Mon Jun 07 10:10:45 2010 +0200
+++ b/MonetDB5/src/mal/mal_interpreter.mx       Wed Jun 09 14:45:39 2010 +0200
@@ -2496,8 +2496,8 @@
                MT_set_lock(*lock, "timing");
        stream_printf(cntxt->fdout,"= ");       /* single column rendering */
        if( cntxt->flags & timerFlag){
-               char buf[BUFSIZ];
-               snprintf(buf,BUFSIZ,LLFMT,GDKusec()-cntxt->timer);
+               char buf[32];
+               snprintf(buf,sizeof(buf),LLFMT,GDKusec()-cntxt->timer);
                stream_printf(cntxt->fdout, "%8s usec ",buf);
        }
        if( cntxt->flags & threadFlag)
@@ -2533,8 +2533,8 @@
                stream_printf(cntxt->fdout," ");
        }
        if (cntxt->flags & cntFlag){
-               char buf[BUFSIZ];
-               snprintf(buf, BUFSIZ, BUNFMT , cntxt->cnt);
+               char buf[32];
+               snprintf(buf, sizeof(buf), BUNFMT , cntxt->cnt);
                stream_printf(cntxt->fdout,":%6s ", buf);
        }
        {str line;
@@ -2589,8 +2589,8 @@
 }
 
 void displayVolume(Client cntxt, lng vol){
-       char buf[BUFSIZ];
-       formatVolume(buf,BUFSIZ,vol);
+       char buf[32];
+       formatVolume(buf,(int)sizeof(buf),vol);
        stream_printf(cntxt->fdout,"%s",buf);
 }
 @h
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to