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

Reduce stack usage.

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


diffs (36 lines):

diff -r ba323345dd9e -r 9fe5beb976cf MonetDB5/src/mal/mal_interpreter.mx
--- a/MonetDB5/src/mal/mal_interpreter.mx       Mon Jun 07 09:42:27 2010 +0200
+++ b/MonetDB5/src/mal/mal_interpreter.mx       Wed Jun 09 14:44:42 2010 +0200
@@ -2454,8 +2454,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)
@@ -2491,8 +2491,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;
@@ -2547,8 +2547,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
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to