Commit Graph

93 Commits

Author SHA1 Message Date
Ryuan Choi 2692234b60 Moved brace of extern "C" to fix build break in c++ applications 2013-07-28 20:38:34 +09:00
Jérémy Zurcher fc4e117e10 remove double def of Eo_Callback_Priority 2013-07-23 19:41:37 +00:00
Cedric Bail 1dd7ed18bc eo: turn Eo API in a beta API as discussion are still ongoing. 2013-07-23 11:27:29 +09:00
Cedric Bail 60eb5d07ea eo: simplify callbacks array declaration for the lazy tasn. 2013-07-17 11:05:50 +09:00
Cedric Bail e939d9a1ce eo: let's add a macro to define a callbacks array. 2013-07-16 20:03:48 +09:00
Cedric Bail cecd19803e eo: let's handle memory allocation gracefully. 2013-07-16 20:03:48 +09:00
Cedric Bail 166e89baac Revert "eo: try to fix callback array to work on other system."
This reverts commit e89f32d28d.
2013-07-16 15:18:16 +09:00
Cedric Bail ebb36c98a8 eo: micro optimization speed up callback call by 3%. 2013-07-16 13:45:36 +09:00
Cedric Bail e89f32d28d eo: try to fix callback array to work on other system. 2013-07-16 13:41:27 +09:00
Cedric Bail cb5dbb55c3 eo: reporting error here just make the caller code more complex for nothing valuable. 2013-07-05 10:18:19 +09:00
Cedric Bail a865b77c14 eo: another small micro optimization giving a 10% speed increase. 2013-07-04 13:02:28 +09:00
Cedric Bail cc012b754c eo: little micro optimization. 2013-07-01 18:35:55 +09:00
Cedric Bail c435968f69 eo: a little more inlining, give me a 10% speed improvement. 2013-07-01 18:18:40 +09:00
Cedric Bail dcf65a8eec eo: add a new macro to make the code easier to read and use it. 2013-06-28 15:28:30 +09:00
Cedric Bail 7849c5de32 eo: 30% speed improvement in message propagation. 2013-06-28 10:18:39 +09:00
Jérémy Zurcher 8619bf1323 eo_class_new: reorder last operations in class creation 2013-06-18 00:08:58 +02:00
Jérémy Zurcher 2350f1fb30 eo_class_new: pack ext data offsets at the end of _Eo_Class 2013-06-17 23:48:22 +02:00
Jérémy Zurcher 841b46fc90 eo_class_new: speed up mixins offset table creation 2013-06-17 23:47:15 +02:00
Jérémy Zurcher 5f83d1a80b eo_class_new: check parent and desc before doing anything 2013-06-17 23:41:45 +02:00
Jérémy Zurcher 4eb2fb0bb6 eo_class_new: pack mro at the end of _Eo_Class 2013-06-17 23:41:02 +02:00
Jérémy Zurcher e0293a421f eo_class_new: remove duplicates in extensions as well as in mro 2013-06-17 23:38:04 +02:00
Jérémy Zurcher 2f79056078 eo_class_new: pack extensions at the end of _Eo_Class 2013-06-17 23:35:48 +02:00
Jérémy Zurcher 0c4c7ecd3a eo_class_new: add and use _eo_class_sz 2013-06-17 23:33:19 +02:00
Jérémy Zurcher 4d2f4a1ae5 eo_class_new: replace class field extn_data_size with obj_size 2013-06-17 23:32:50 +02:00
Jérémy Zurcher 1f7ae48215 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
2013-06-10 16:42:15 +02:00
Jérémy Zurcher 4e742bf0bf eo: fix advertised object size in dbg msg 2013-06-10 16:42:15 +02:00
Daniel Zaoui a435306974 Eo: improve error message. 2013-06-03 14:31:31 +03:00
Tom Hacohen 6e3f555fe4 Eo: Made del event an hot event (we always want to get it). 2013-05-21 15:07:41 +01:00
Cedric Bail 1db92f9ac0 eo: some event should not be frozen. 2013-05-20 18:17:29 +09:00
Jérémy Zurcher 6667acf5a2 eo ptr ind: fix comments 2013-05-17 11:39:01 +02:00
Jérémy Zurcher f253cfc12c eo ptr ind: empty tables are freed except 1 kept as spare
- this reduces unused memory usage
- the spare table avoids the free/alloc corner case
2013-05-17 10:35:16 +02:00
Jérémy Zurcher 3e4127da52 eo ptr ind: current_table -> _current_table 2013-05-17 09:23:00 +02:00
Jérémy Zurcher 5244c20118 eo ptr ind: store partial Eo Id in the table
- very small speed up
- maybe later use this to avoid table indexes not NULL checks
  in _eo_id_release and _eo_obj_pointer_get
2013-05-16 15:00:08 +02:00
Jérémy Zurcher f2efa26459 eo ptr ind: use of mprotect when EINA_DEBUG_MALLOC is set
- to enable this feature, compile with --with-profile=debug
- the mid tables and tables are write protected after modifications,
  you will segfault if you mess with them
2013-05-16 13:17:12 +02:00
Jérémy Zurcher 380435abdb eo ptr ind: set generation counter range to [1;max-1]
- so we never generate an Eo Id equal to 0,
  thus don't need to skip the first top table index anymore
2013-05-16 13:17:12 +02:00
Jérémy Zurcher 00af0e77e3 eo ptr ind: minimize amount of wasted memory
- because of mmap PAGE_SIZE alignement and added magic header, almost a
  memory page is wasted per table and mid table allocation.
- reducing the number of tables per mid table and the number of entries
  per table solves this.
2013-05-16 13:17:11 +02:00
Jérémy Zurcher a9e69d519c eo ptr ind: mostly cosmetic
- add and use SHIFT_* macros
- rename queue into fifo
- try to clarify the structure top table -> mid table -> table[entry]
2013-05-16 13:17:11 +02:00
Stefan Schmidt 7ac997c5bb eo: Fix memleak in EO_DBG_INFO_APPEND macro
If List is NULL we would never make any use of the alloced Tmp. Better check
for NULL before doing the actual alloc and doing the work.
2013-05-14 14:08:01 +01:00
Jérémy Zurcher 4e88ad4dd6 eo ptr in: follow naming convention for static fcts 2013-05-05 18:19:14 +02:00
Jérémy Zurcher 1953f10b18 eo ptr ind: fix cast when eo_id is disabled 2013-05-05 15:18:01 +02:00
Jérémy Zurcher 94b6dff74c eo ptr ind: speed up by caching last used table
- keep a reference to the last used table and it's indexes
   - use this table prior to normal search through table arrays
2013-05-05 15:18:01 +02:00
Jérémy Zurcher 10aafd711d eo ptr ind: fix indentation 2013-05-05 15:18:01 +02:00
Jérémy Zurcher f769128dca eo ptr ind: pack memory, use in mmap fifo as recycle trash
- pack active flag and generation nbr in an _Eo_Id_Entry struct
  - replace Eina_Trash with a fifo which lives in mmaped memory owned by eo_id.
  - fifo uses indexes instead of pointers to spare memory
  - never used entries are served first, then those in the fifo
    are reused, thus we ensure that a freed entry won't soon be reused.
2013-05-03 21:28:32 +02:00
Daniel Zaoui 08d81394aa Eo: fix for castings. 2013-05-02 15:31:57 +03:00
Daniel Zaoui af401b4083 Eo: fix for unitialized value 2013-05-01 21:45:57 +03:00
Daniel Zaoui f6a37f88d2 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.
2013-05-01 10:37:08 +03:00
Daniel Zaoui 2ac4cdce76 Eo: Fix for warning on 64 bits. 2013-04-30 15:41:05 +03:00
Jérémy Zurcher 994318eebe eo_ptr_ind: pack ptr, active flag and generation all together
use of an array of the below struct instead of 3 separate arrays
leads to better cache performance and smaller memory usage
typedef struct
{
  _Eo *ptr;
  unsigned int active     : 1;
  unsigned int generation : BITS_FOR_GENERATION_COUNTER;
} _Eo_Id_Entry;
2013-04-28 00:43:53 +02:00
Jérémy Zurcher 41dc1764f3 eo_ptr_ind: fix hdr->size in _eo_id_mem_alloc 2013-04-28 00:17:07 +02:00
Daniel Willmann 7f87d9891d eo: Fix incorrect pointer allocation
We want to allocate sizeof(Eo_Dbg_Info) - not sizeof(Eo_Dbg_Info *)
bytes.
2013-04-24 23:27:48 +01:00