raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=54c39aa564a28a8588aa0d53ee284cf8761c9963

commit 54c39aa564a28a8588aa0d53ee284cf8761c9963
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Fri Sep 9 11:19:01 2016 +0900

    eo class add - dont always call getenv as this is epxensive.  get once
    
    so class creation is possibly a little slower thanks to always calling
    getenv. get once then store rsult from there on out.
---
 src/lib/eo/eo.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index d90d417..e75e36c 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1335,7 +1335,14 @@ efl_class_new(const Efl_Class_Description *desc, const 
Efl_Class *parent_id, ...
      }
 
    klass->obj_size = extn_data_off;
-   if (getenv("EO_DEBUG"))
+   static unsigned char _eo_debug = 0;
+
+   if (_eo_debug == 0)
+     {
+        if (getenv("EO_DEBUG")) _eo_debug = 2;
+        else _eo_debug = 1;
+     }
+   if (_eo_debug == 2)
      {
         fprintf(stderr, "Eo class '%s' will take %u bytes per object.\n",
                 desc->name, klass->obj_size);

-- 


Reply via email to