[gegl] gegl: make GEGL_ALLOCA_THRESHOLD platform dependent



commit 305335535792903aa52e739b7fe7aa7b653cfd7f
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Jan 29 15:29:54 2018 +0100

    gegl: make GEGL_ALLOCA_THRESHOLD platform dependent
    
    Primary motivation being that we then get a higher number of
    linux/OSX making it possible for more temporary allocations
    inside buffer handling to avoid the function call overheads
    of malloc/free.

 gegl/gegl-types-internal.h |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gegl/gegl-types-internal.h b/gegl/gegl-types-internal.h
index 74a9740..335c112 100644
--- a/gegl/gegl-types-internal.h
+++ b/gegl/gegl-types-internal.h
@@ -105,8 +105,16 @@ GEGL_CACHED_BABL(format, yA_float, "Y'aA float")
 GEGL_CACHED_BABL(format, ya_linear_float, "Y float")
 GEGL_CACHED_BABL(format, yA_linear_float, "YaA float")
 
+
+#ifdef G_OS_WIN32
+  /* one use 16kb of stack before an exception triggered warning on win32 */
+  #define GEGL_ALLOCA_THRESHOLD  8192
+#else
+/* on linux/OSX 0.5mb is reasonable, the stack size of new threads is 2MB */
+  #define GEGL_ALLOCA_THRESHOLD  (1024*1024/2)
+#endif
+
 G_END_DECLS
 
-#define GEGL_ALLOCA_THRESHOLD  8192 * 8   /* maybe this needs to be reduced for win32? */
 
 #endif /* __GEGL_TYPES_INTERNAL_H__ */


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