shithub: boids

Download patch

ref: e93cc98dc53f3f3480c0ad2b26e0e98735ed791f
parent: 6572c456f7cdf6f8aaaf361e618b41816084a7ae
author: rodri <[email protected]>
date: Tue Jun 9 18:43:41 EDT 2020

unnecessary realloc tagging.

--- a/main.c
+++ b/main.c
@@ -68,7 +68,6 @@
 		f->birds = realloc(f->birds, ++f->nbirds*sizeof(Bird));
 		if(f->birds == nil)
 			sysfatal("realloc: %r");
-		setrealloctag(f->birds, getcallerpc(&nbirds));
 		b = &f->birds[f->nbirds-1];
 		b->p = Pt2(frand()*Dx(jail),frand()*Dy(jail),1);
 		b->v = Vec2(cos(frand()*2*PI),sin(frand()*2*PI));
@@ -75,6 +74,7 @@
 		b->v = mulpt2(b->v, TERMINALV);
 		b->color = pal[Cfg];
 	}
+	setrealloctag(f->birds, getcallerpc(&nbirds));
 
 	return f;
 }