Commit Graph

16 Commits

Author SHA1 Message Date
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
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 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
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
Carsten Haitzler 76a748b08d rejig 32bit eoid allocation to 5.5.12. 2013-04-24 16:20:18 +09:00
Carsten Haitzler 4cf68bf728 eoid -> use mmap for allocating id tables. makes it a separate memory
regions with page separations... this allows us more direct control
over access and visibility.
2013-04-23 23:39:37 +09:00
Carsten Haitzler c9ad644be2 eoid -> rjid 64bit bit allocations for.. not so much bloat. 2013-04-23 23:39:37 +09:00
Daniel Zaoui 337fac0e73 Eo: pointers indirection mechanism for objects and classes
Summary: This feature replaces Eo pointers with ids to prevent bad usage
or reuse of these pointers. It doesn't change API.
The mechanism uses tables storing the real pointers to the objects.
See the src/lib/eo/eo_ptr_indirection.c file for more details on the
mechanism.
2013-04-23 09:50:40 +03:00