cedric pushed a commit to branch master.

commit 4d316f3becfe81fe421987bb573a603d883fc7e1
Author: Cedric BAIL <[email protected]>
Date:   Tue Mar 12 19:01:32 2013 +0900

    eo, evas, edje: reorder structure for reducing memory usage.
---
 src/lib/edje/edje_private.h            | 46 +++++++++++++++++-----------------
 src/lib/eo/eo.c                        |  9 ++++---
 src/lib/evas/canvas/evas_object_text.c | 29 +++++++++++----------
 src/lib/evas/include/evas_private.h    | 18 ++++++-------
 4 files changed, 53 insertions(+), 49 deletions(-)

diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 6a93b5e..6e849ec 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1234,9 +1234,6 @@ struct _Edje
    const char           *group;
    const char           *parent;
 
-   Evas_Coord            x, y, w, h;
-   Edje_Size             min;
-   double                paused_at;
    Evas_Object          *obj; /* the smart object */
    Edje_File            *file; /* the file the data comes form */
    Edje_Part_Collection *collection; /* the description being used */
@@ -1254,8 +1251,6 @@ struct _Edje
    Eina_List            *markup_filter_callbacks;
    void                 *script_only_data;
 
-   unsigned int          table_parts_size;
-
    Eina_List            *groups;
 
    struct {
@@ -1267,13 +1262,6 @@ struct _Edje
 
    const Edje_Signal_Callback_Group *callbacks;
 
-   int                   references;
-   int                   block;
-   int                   load_error;
-   int                   freeze;
-   FLOAT_T              scale;
-   Eina_Bool             is_rtl : 1;
-
    struct {
       Edje_Text_Change_Cb  func;
       void                *data;
@@ -1284,29 +1272,41 @@ struct _Edje
       void                    *data;
       int                      num;
    } message;
-   int                   processing_messages;
 
-   int                   state;
+   struct {
+      Edje_Item_Provider_Cb  func;
+      void                  *data;
+   } item_provider;
 
-   int                  preload_count;
+#ifdef HAVE_EPHYSICS
+   EPhysics_World       *world;
+#endif
+
+   Eina_List            *user_defined;
 
    lua_State            *L;
    Eina_Inlist          *lua_objs;
    int                   lua_ref;
 
-   struct {
-      Edje_Item_Provider_Cb  func;
-      void                  *data;
-   } item_provider;
+   int                   processing_messages;
+   int                   state;
+   int                  preload_count;
 
-   Eina_List            *user_defined;
+   unsigned int          table_parts_size;
 
    int                   walking_callbacks;
 
-#ifdef HAVE_EPHYSICS
-   EPhysics_World       *world;
-#endif
+   int                   references;
+   int                   block;
+   int                   load_error;
+   int                   freeze;
+
+   Evas_Coord            x, y, w, h;
+   Edje_Size             min;
+   double                paused_at;
+   FLOAT_T              scale;
 
+   Eina_Bool          is_rtl : 1;
    Eina_Bool          dirty : 1;
    Eina_Bool          recalc : 1;
    Eina_Bool          delete_callbacks : 1;
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 141d3b1..34c6cbf 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -38,7 +38,6 @@ struct _Eo {
      Eo *parent;
      Eina_Inlist *children;
      const Eo_Class *klass;
-     int refcount;
 #ifdef EO_DEBUG
      Eina_Inlist *xrefs;
 #endif
@@ -47,6 +46,8 @@ struct _Eo {
 
      Eo_Kls_Itr mro_itr;
 
+     int refcount;
+
      Eina_Bool do_error:1;
      Eina_Bool condtor_done:1;
 
@@ -99,17 +100,17 @@ struct _Eo_Class
    const Eo_Class *parent;
    const Eo_Class_Description *desc;
    Dich_Chain1 *chain; /**< The size is chain size */
-   size_t chain_size;
-   size_t base_id;
 
    const Eo_Class **extensions;
 
    Eo_Extension_Data_Offset *extn_data_off;
-   size_t extn_data_size;
 
    const Eo_Class **mro;
    Eo_Kls_Itr mro_itr;
 
+   size_t extn_data_size;
+   size_t chain_size;
+   size_t base_id;
    size_t data_offset; /* < Offset of the data within object data. */
 
    Eina_Bool constructed : 1;
diff --git a/src/lib/evas/canvas/evas_object_text.c 
b/src/lib/evas/canvas/evas_object_text.c
index 3b27712..c31ddd4 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -25,33 +25,36 @@ struct _Evas_Object_Text
    DATA32               magic;
 
    struct {
+      struct {
+        unsigned char  r, g, b, a;
+      } outline, shadow, glow, glow2;
+
       const char          *utf8_text; /* The text exposed to the API */
       const char          *font;
       Evas_Font_Description *fdesc;
       const char          *source;
-      Evas_Font_Size       size;
-      struct {
-        unsigned char  r, g, b, a;
-      } outline, shadow, glow, glow2;
+      Eina_Unicode        *text;
 
-      unsigned char        style;
       double               ellipsis;
-      Eina_Unicode        *text;
+
+      Evas_Font_Size       size;
+      unsigned char        style;
    } cur, prev;
 
-   float                       ascent, descent;
-   float                       max_ascent, max_descent;
+   struct {
+      Evas_Object_Text_Item    *ellipsis_start;
+      Evas_Object_Text_Item    *ellipsis_end;
+      Evas_Coord                w, h;
+   } last_computed;
+
    Evas_BiDi_Paragraph_Props  *bidi_par_props;
    const char                 *bidi_delimiters;
    Evas_Object_Text_Item      *items;
 
    Evas_Font_Set              *font;
 
-   struct {
-      Evas_Coord                w, h;
-      Evas_Object_Text_Item    *ellipsis_start;
-      Evas_Object_Text_Item    *ellipsis_end;
-   } last_computed;
+   float                       ascent, descent;
+   float                       max_ascent, max_descent;
 
    Evas_BiDi_Direction         bidi_dir : 2;
    char                        changed : 1;
diff --git a/src/lib/evas/include/evas_private.h 
b/src/lib/evas/include/evas_private.h
index d8f1e70..a8e01ee 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -612,12 +612,6 @@ struct _Evas_Object_Protected_Data
 
    unsigned char               delete_me;
 
-   Evas_Object_Pointer_Mode    pointer_mode : 2;
-
-   Eina_Bool                   store : 1;
-   Eina_Bool                   pass_events : 1;
-   Eina_Bool                   freeze_events : 1;
-   Eina_Bool                   repeat_events : 1;
    struct  {
       Eina_Bool                pass_events : 1;
       Eina_Bool                pass_events_valid : 1;
@@ -626,28 +620,34 @@ struct _Evas_Object_Protected_Data
       Eina_Bool                src_invisible : 1;
       Eina_Bool                src_invisible_valid : 1;
    } parent_cache;
+
+   Evas_Object_Pointer_Mode    pointer_mode : 2;
+   Eina_Bool                   store : 1;
+   Eina_Bool                   pass_events : 1;
+   Eina_Bool                   freeze_events : 1;
+   Eina_Bool                   repeat_events : 1;
    Eina_Bool                   restack : 1;
    Eina_Bool                   is_active : 1;
+
    Eina_Bool                   precise_is_inside : 1;
    Eina_Bool                   is_static_clip : 1;
-
    Eina_Bool                   render_pre : 1;
    Eina_Bool                   rect_del : 1;
    Eina_Bool                   mouse_in : 1;
    Eina_Bool                   pre_render_done : 1;
    Eina_Bool                   intercepted : 1;
    Eina_Bool                   focused : 1;
+
    Eina_Bool                   in_layer : 1;
    Eina_Bool                   no_propagate : 1;
-
    Eina_Bool                   changed : 1;
    Eina_Bool                   changed_move : 1;
    Eina_Bool                   changed_color : 1;
    Eina_Bool                   changed_map : 1;
    Eina_Bool                   changed_pchange : 1;
    Eina_Bool                   changed_src_visible : 1;
-   Eina_Bool                   del_ref : 1;
 
+   Eina_Bool                   del_ref : 1;
    Eina_Bool                   is_frame : 1;
    Eina_Bool                   child_has_map : 1;
    Eina_Bool                   eo_del_called : 1;

-- 

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev

Reply via email to