jeyzu pushed a commit to branch master.

commit 1f7ae48215168724d35e6c8076eba39eef47ee72
Author: Jérémy Zurcher <[email protected]>
Date:   Mon Jun 10 16:19:43 2013 +0200

    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 737ab9b..0f2c654 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);

-- 

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j

Reply via email to