[gegl] GeglNodePrivate reduced maximum number of evalmgrs to 8



commit 1704f7573406723dac00db503d64abbbc3a14851
Author: �yvind Kolås <pippin gimp org>
Date:   Sat Dec 5 15:57:33 2009 +0000

    GeglNodePrivate reduced maximum number of evalmgrs to 8
    
    This makes the full GeglNodePrivate data structure fit in a single
    cacheline.

 gegl/graph/gegl-node.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index c471ca2..fc9e31e 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -61,6 +61,7 @@ enum
   LAST_SIGNAL
 };
 
+#define MAX_THREADS 8
 
 struct _GeglNodePrivate
 {
@@ -70,8 +71,8 @@ struct _GeglNodePrivate
   GeglNode       *parent;
   gchar          *name;
   GeglProcessor  *processor;
-  GeglEvalMgr    *eval_mgr[16];
   GHashTable     *contexts;
+  GeglEvalMgr    *eval_mgr[MAX_THREADS];
 };
 
 
@@ -925,6 +926,8 @@ gegl_node_blit (GeglNode            *self,
 
 #if ENABLE_MT
   threads = gegl_config ()->threads;
+  if (threads > MAX_THREADS)
+    threads = 0;
   
   if (pool == NULL)
     {
@@ -944,7 +947,7 @@ gegl_node_blit (GeglNode            *self,
                               */
   if (flags == GEGL_BLIT_DEFAULT)
     {
-      ThreadData data[16];
+      ThreadData data[MAX_THREADS];
       gint i;
 
       /* Subdivide along the largest of width/height, this should be further



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