From 1f7ae48215168724d35e6c8076eba39eef47ee72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 10 Jun 2013 16:19:43 +0200 Subject: [PATCH] eo_class_new: fix big memory waste extn_data_size is not equal to extn_data_off, current class data size and data offset must be substracted first elementary_test bubble peak usage goes from 13.7 MiB to 12.5 MiB --- src/lib/eo/eo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 737ab9b079..0f2c65422a 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -1005,7 +1005,8 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...) mro_itr++; } - klass->extn_data_size = extn_data_off; + klass->extn_data_size = extn_data_off + - klass->data_offset - EO_ALIGN_SIZE(klass->desc->data_size); } eina_lock_take(&_eo_class_creation_lock);