[Gridflow-cvs] [svn] commit: r4027 - /trunk/base/grid.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Mon Jul 14 16:22:34 EDT 2008


Author: matju
Date: Mon Jul 14 16:22:34 2008
New Revision: 4027

Log:
only allocate output buffer when it gets finally used

Modified:
    trunk/base/grid.c

Modified: trunk/base/grid.c
==============================================================================
--- trunk/base/grid.c (original)
+++ trunk/base/grid.c Mon Jul 14 16:22:34 2008
@@ -260,7 +260,6 @@
 	outlet_anything(parent->bself->outlets[woutlet],bsym._grid,1,a);
 	frozen=true;
 	if (!dim->prod()) {finish(); return;}
-	create_buf();
 }
 
 // send modifies dex; send_direct doesn't
@@ -275,6 +274,7 @@
 }
 
 void GridOutlet::flush() {TRACE;
+	if (!buf) return;
 	if (!bufi) return;
 #define FOO(T) send_direct(bufi,(T *)*buf);
 	TYPESWITCH(buf->nt,FOO,)
@@ -308,6 +308,7 @@
 			send_direct(n,data);
 		} else {
 			//post("send_indirect %d",n);
+			if (!buf) create_buf();
 			COPY((T *)*buf+bufi,data,n);
 			bufi += n;
 		}



More information about the Gridflow-cvs mailing list