[gegl] plasma: Don't allocate a single array for all colors



commit d5aebd0466afcccd64141d7c37e255cbb1604b8a
Author: Mukund Sivaraman <muks banu com>
Date:   Thu Jun 30 14:22:19 2011 +0530

    plasma: Don't allocate a single array for all colors
    
    This also plugs the memory leak here, as the colors are now
    on the stack.

 operations/workshop/plasma.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/operations/workshop/plasma.c b/operations/workshop/plasma.c
index c6e4119..018b83d 100644
--- a/operations/workshop/plasma.c
+++ b/operations/workshop/plasma.c
@@ -114,8 +114,8 @@ do_plasma_big (GeglBuffer *output,
                GRand      *gr,
                GeglChantO *op)
 {
-  gfloat *tl, *ml, *bl, *mt, *mm, *mb, *tr, *mr, *br;
-  gfloat *tmp;
+  gfloat tl[4], ml[4], bl[4], mt[4], mm[4], mb[4], tr[4], mr[4], br[4];
+  gfloat tmp[4];
   gint    xm, ym;
   gfloat  ran;
   static gint count = 0;
@@ -124,8 +124,6 @@ do_plasma_big (GeglBuffer *output,
   gfloat        *src_buf;
   gboolean       toreturn;
   */
-  tl = ml = bl = mt = mm = mb = tr = mr = br = tmp
-     = g_new0 (gfloat, floats_per_pixel);  
 
   xm = (x1 + x2) / 2;
   ym = (y1 + y2) / 2;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]