cedric pushed a commit to branch master.

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

commit c25ba993f6125ce402f6450e8ab82df8474cf91a
Author: Cedric BAIL <[email protected]>
Date:   Tue Jan 20 18:27:59 2015 +0100

    evas: reduce potential memory hole in Evas_Object_Protected_State.
    
    The main difference between 1.12 and 1.13 memory foot print is actually
    related to this two pointer to mask. I am wondering if there is not an
    issue here also has we do have a duplicated pointer. We have prev_mask
    and mask in both cur and prev state of an Evas_Object, but only mask
    and prev_mask from the cur state seems to be accessed.
    
    If we can remove two pointers from those state, we should have a decent
    win in expedite benchmark. Hopefully 300KB to win there (Close to half
    the additional cost in memory).
---
 src/lib/evas/canvas/evas_object_main.c | 2 +-
 src/lib/evas/include/evas_private.h    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_main.c 
b/src/lib/evas/canvas/evas_object_main.c
index 208a29e..7c2ea94 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -28,7 +28,7 @@ static const Evas_Object_Map_Data default_map = {
 };
 static const Evas_Object_Protected_State default_state = {
   NULL, { 0, 0, 0, 0 },
-  { { 0, 0, 0, 0,  0, 0, 0, 0, NULL, EINA_FALSE, EINA_FALSE } },
+  { { NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, EINA_FALSE, EINA_FALSE } },
   { 255, 255, 255, 255 },
   1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, 
EINA_FALSE, EINA_FALSE
 };
diff --git a/src/lib/evas/include/evas_private.h 
b/src/lib/evas/include/evas_private.h
index 6283c85..7e082a6 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -908,9 +908,10 @@ struct _Evas_Object_Protected_State
    Evas_Coord_Rectangle  geometry;
    struct {
       struct {
+         const Evas_Object_Protected_Data *mask, *prev_mask;
+
          Evas_Coord      x, y, w, h;
          unsigned char   r, g, b, a;
-         const Evas_Object_Protected_Data *mask, *prev_mask;
          Eina_Bool       visible : 1;
          Eina_Bool       dirty : 1;
       } clip;

-- 


Reply via email to