jeyzu pushed a commit to branch master.

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

commit b763db3666ecbfa222015ce75dd5a3c775c5bad9
Author: Jérémy Zurcher <jer...@asynk.ch>
Date:   Wed Mar 5 22:44:21 2014 +0100

    eo: memory waste at mixin class elaboration
    
    @fix
    
    mixins data offsets are stored in Eo_Extension_Data_Offset[],
    if the constructed class is a mixin, do not reserve space for its
    private data, the class is in mixins list and will be handled at
    Eo_Extension_Data_Offset computation.
    
    see  _eo_data_scope_get(...) for private data retrieval
---
 src/lib/eo/eo.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index eaca6c8..bce20dd 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -940,8 +940,9 @@ eo_class_new(const Eo_Class_Description *desc, const 
Eo_Class *parent_id, ...)
         *(mro_itr) = NULL;
      }
 
-   size_t extn_data_off = klass->data_offset +
-      EO_ALIGN_SIZE(klass->desc->data_size);
+   size_t extn_data_off = klass->data_offset;
+   if (klass->desc->type != EO_CLASS_TYPE_MIXIN)
+      extn_data_off += EO_ALIGN_SIZE(klass->desc->data_size);
 
    /* Feed the mixins data offsets and free the mixins list. */
      {

-- 


Reply via email to