path: root/src/tests/eo/function_overrides
diff options
authorDaniel Zaoui <>2013-03-20 08:56:15 +0200
committerDaniel Zaoui <>2013-05-01 10:37:08 +0300
commitf6a37f88d26a4a00c50f38d078b4047c24992bcb (patch)
tree0c212f61728c0072a717f2feffd780e5ba5b82dc /src/tests/eo/function_overrides
parentdee226221447fad70c8e847014f34789d207a549 (diff)
Eo: Add reference functions for objects data
We want to introduce a new mechanism concerning the data of the Eo objects. The goal is to improve the memory management by defragmenting the memory banks used by the Eo objects. The first phase has been done by raster and consists in allocating the objects into a separate memory region that the one used by malloc. So now, we know where our objects are located. Now, moving objects means moving data of objects. The issue we have here is that a lot of data pointers are stored into data of other objects, e.g Evas Object data into lists for rendering... We need a way to reference the data and eo_data_get doesn't provide us that. So we need to improve the API for data extraction by requesting from the developer if the data will be stored or not. Five functions are supplied: - eo_data_scope_get: no referencing, the data pointer is no more used after exiting the function. - eo_data_ref: reference the data of the object. It means that while the data is referenced, the object cannot be moved. - eo_data_xref: reference the data of the object but for debug purpose, we associate the objects that references. Same behavior as eo_data_ref for non-debug. - eo_data_unref: unreference the data of an object. - eo_data_xunref: unreference the data of an object previously referenced by another object. I deprecated the eo_data_get function. Most of the time, eo_data_scope_get needs to be used. In the next patches, I changed the eo_data_get to the corresponding functions, according to the usage of the data pointer. The next step is to find all the places in the code where the data is stored but not yet referenced. This will be done by: - requesting from every object to unreference all data to other objects. - moving all the objects from one region to another - requesting from every object to rerefenrence the data. - debugging by hunting the segmentation faults and other weird creatures.
Diffstat (limited to 'src/tests/eo/function_overrides')
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tests/eo/function_overrides/function_overrides_main.c b/src/tests/eo/function_overrides/function_overrides_main.c
index 48ab4bd1ab..c93e3130e1 100644
--- a/src/tests/eo/function_overrides/function_overrides_main.c
+++ b/src/tests/eo/function_overrides/function_overrides_main.c
@@ -20,7 +20,7 @@ main(int argc, char *argv[])
20 Eo *obj = eo_add(INHERIT2_CLASS, NULL); 20 Eo *obj = eo_add(INHERIT2_CLASS, NULL);
21 21
22 eo_do(obj, simple_a_set(1)); 22 eo_do(obj, simple_a_set(1));
23 Simple_Public_Data *pd = eo_data_get(obj, SIMPLE_CLASS); 23 Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS);
24 fail_if(pd->a != 2); 24 fail_if(pd->a != 2);
25 25
26 eo_unref(obj); 26 eo_unref(obj);
@@ -28,7 +28,7 @@ main(int argc, char *argv[])
28 obj = eo_add(INHERIT3_CLASS, NULL); 28 obj = eo_add(INHERIT3_CLASS, NULL);
29 29
30 eo_do(obj, simple_a_set(1)); 30 eo_do(obj, simple_a_set(1));
31 pd = eo_data_get(obj, SIMPLE_CLASS); 31 pd = eo_data_scope_get(obj, SIMPLE_CLASS);
32 fail_if(pd->a != 3); 32 fail_if(pd->a != 3);
33 33
34 eo_unref(obj); 34 eo_unref(obj);