From b763db3666ecbfa222015ce75dd5a3c775c5bad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 5 Mar 2014 22:44:21 +0100 Subject: [PATCH] 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 eaca6c8b29..bce20dd4a1 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. */ {