Commit Graph

152 Commits

Author SHA1 Message Date
Jérémy Zurcher 3ea1f7ae7c eo: rename _Eo_Internal -> _Eo_Object 2013-09-24 14:53:49 +01:00
Jérémy Zurcher dc63739a9d eo: typedef uintptr_t Eo_Id; as Eo_Class_Id 2013-09-24 14:53:05 +01:00
Jérémy Zurcher 2041e995fc eo: fix EO_DEBUG compilation 2013-09-23 11:07:07 +02:00
Jérémy Zurcher 027548011c eo_ptr_indirection.x: fix _eo_id_release when !HAVE_EO_ID 2013-09-18 17:12:15 +02:00
Cedric Bail 7f23deb723 eo: fix typo. 2013-09-13 16:46:08 +09:00
Cedric Bail cd77853222 eo: add eo_childrens_iterator_new().
The goal would be to replace the smart children list and friends. The
problem is that they differ in content. Smart children and Eo children are
the same, but Elm children and them differ. If I put this function as a
virtual, it would be possible to override the list of children and if we
start using it in Evas render loop, that could result in "weird" behavior.

I have added the use of a simplified Eina_Trash mempool kind of feature
to have some fast path for allocation if we start using it in Evas render
loop.
2013-09-11 16:08:06 +09:00
Cedric Bail 5290befb53 eo: add a small object cache to make memory recycling faster. 2013-09-11 11:23:50 +09:00
Tom Hacohen 77cf31d322 Eo: Set (again, got removed) deleted eo objects' magic.
The French tried to sneak a bug in, they failed.
Bug was introduced in 337fac0e73.
2013-09-10 15:57:34 +01:00
Jérémy Zurcher 5afa29af59 eo: slight speed up 2013-08-09 16:03:09 +02:00
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
Tom Hacohen 007bdd41c1 Eo: Eo_Class_Id should be uintptr_t not size_t. 2013-04-24 16:55:11 +01: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
Daniel Willmann 8a19bb4b29 Eo: Print location of the calling functions in eo log output
Because of the way eo is dispatching method calls of objects the usual
error log you get if you mix up objects or try to call non-existent
methods is:

ERR<12404>:eo lib/eo/eo.c:362 _eo_dov_internal() Can't find func for op
0x24 (ecore_audio_obj_in:ECORE_AUDIO_OBJ_IN_SUB_ID_SPEED_GET) for class
'ecore_audio_obj_out_pulse'. Aborting.

Of course the problem is not really in lib/eo/eo.c, but in the function
calling eo_do()

Now the macros pass source file and line number on to the _internal
functions so we can log where the error originally happened:

ERR<1938>:eo lib/eo/eo.c:362 _eo_dov_internal() in
lib/ecore_audio/ecore_audio_obj_out_pulse.c:119: Can't find func for op
0x24 (ecore_audio_obj_in:ECORE_AUDIO_OBJ_IN_SUB_ID_SPEED_GET) for class
'ecore_audio_obj_out_pulse'. Aborting.

This makes debugging with eo a lot easier.

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
2013-04-17 15:56:45 +01:00
Tom Hacohen 269e3a7797 Eo: Fixed an error in in _eo_callback_remove and a few minor things.
The other things are not really issues but more about silencing clang.
Thanks to clang-analyzer.
2013-04-12 17:17:38 +01:00
Tom Hacohen 263e54d705 Eo: Moved the debug info functions to the base class code. 2013-04-12 13:49:26 +01:00
Tom Hacohen 3e11c380c9 Eo: Added eo_event_callback_array_* functions.
These functions let you pass an array of callbacks instead of just one.
It's more memory efficient to use this if you just add a bulk of events
on the same object.

This commits breaks ABI, and breaks API of the EO_EV_CALLBACK_ADD/DEL
signals (the event info passed).
2013-04-12 12:02:49 +01:00
Tom Hacohen 45fdd4574e Eo base: Reduce object memory footprint. 2013-04-11 17:04:42 +01:00
Tom Hacohen c226a11bfe Eo callbacks: Improve memory footprint of callbacks.
We don't really need a double-linked-list with a pointer to the last item.
This saves us 2 pointers per callback, which is a decent improvement.
2013-04-11 15:07:07 +01:00
Cedric Bail 2d9ec2159c eo: let's cache this value. 2013-04-11 18:07:09 +09:00
Daniel Willmann ab19019711 eo: Indicate that numbers in error messages are in hex - prefix with 0x
The message "Expected a and got b" is a bit misleading :-)

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
2013-04-09 13:45:30 +01:00
Cedric BAIL a13456b04c eo: let's not duplicate our align code with a less efficient one. 2013-04-04 12:21:05 +09:00
Daniel Juyung Seo c16daf940f eo.c: fixed formatting. 2013-04-03 09:31:24 +09:00
Cedric BAIL 2063e4353d efl: integrate eina_log_timing. 2013-03-27 21:43:45 +09:00
Tom Hacohen 83180acf26 Eo: Added cur_klass as a parameter to eo_*_do_super.
We now need to pass the current class to eo_do_super. This is faster and
more memory efficient and generally lets us do things better.

Using the eo_benchmarks we get ~20% speed-up.
2013-03-18 16:14:18 +00:00
Tom Hacohen 1cbcf4e4f8 Eo: Fixed compilation warning.
Cedric: I love it that you don't test your fixes. :).
2013-03-12 11:21:21 +00:00
Cedric BAIL e07a7ac891 eo: 32bits should be enough for any sane object size. 2013-03-12 20:08:42 +09:00
Cedric BAIL 2a9d4d0765 eo: tired, fix language typo. 2013-03-12 19:23:00 +09:00
Cedric BAIL b309d26e3f eo: add a EO_DEBUG environment variable to get some useful statistic. 2013-03-12 19:17:11 +09:00
Cedric BAIL 4d316f3bec eo, evas, edje: reorder structure for reducing memory usage. 2013-03-12 19:17:11 +09:00
Carsten Haitzler 63802e5b84 since Eo.h is inclued in c++ stuff... how about we cast from the void *
return from calloc to Eo_Dbg_Info * since c++ is really unhappy with
this stuff without a cast (silly c++).
2013-03-05 23:00:38 +09:00
Tom Hacohen fc4846fbc6 Eo: Changed EO_DBG_INFO_LIST_APPEND to be an inline function.
It's cleaner. Should have never been a macro. This is part of the effort of
reducing the usage of ({ which is apparently a non standard extension.
We can get rid of most of it and ifdef the rest.
2013-03-05 09:26:07 +00:00
Cedric BAIL 495bcba4ac efl/eo: add an interface to give the list of parameter directly.
I restrained myself to not name it vodooooo !


SVN revision: 83850
2013-02-12 10:20:15 +00:00
Tom Hacohen 4b230bb164 Eo dbg info: Add support for to_string.
SVN revision: 83481
2013-01-30 13:35:31 +00:00
Tom Hacohen 70156285b0 Eo dbg: Use eina_value as the debug info type.
SVN revision: 83443
2013-01-29 16:36:01 +00:00
Aharon Hillel 028f059d32 Clouseau-Eo integration: Added debug info functions.
From now, classes implementing the Eo function with id
EO_BASE_SUB_ID_DBG_INFO_GET will be able to show in Clouseau their own
specific information.
Information contents is controlled by the class itself and no more
by Clouseau. Basic types and lists are supported..

Signed-off-by: Aharon Hillel <a.hillel@samsung.com>

SVN revision: 83410
2013-01-29 06:36:23 +00:00
Tom Hacohen 21a6a84667 Eo: Changed NDEBUG to EO_DEBUG.
This was stupid from the start, but now it casuse even more issues.
We'll have to just add a configure option to it when the time comes.

SVN revision: 82989
2013-01-18 16:57:57 +00:00
Christopher Michael 19b5f5a1b5 Fix doxygen typo.
Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 82416
2013-01-08 14:12:11 +00:00
Cedric BAIL 35a5c733ff eo: let's make weak ref safer to manipulate.
SVN revision: 81899
2012-12-30 12:26:25 +00:00
Gustavo Sverzut Barbieri 2608f68571 efl/docs: clean-up and make it more uniform.
now unified docs are bit more uniform in their start pages, overall
improved but much to do :-(



SVN revision: 81851
2012-12-28 23:26:05 +00:00
Leandro Dorileo 99a56aa411 eo: fix memory leak on _eo_class_mro_add
SVN revision: 80983
2012-12-14 20:03:25 +00:00
Vincent Torri 58a9a0ad57 merge: don't use recursive subdirs. Compilation should be faster.
Please check.

note1: Only lib and bin for now, but should be extended to other stuff
note2: distcheck does not work because eo_suite is failing.


SVN revision: 78758
2012-11-01 12:56:52 +00:00
Vincent Torri 124e0d4afd merge: add a holdall variable
SVN revision: 78503
2012-10-26 06:57:11 +00:00
Vincent Torri aac3e95ccf merge: -Wl,--enable-auto-import is useless with recent versions of gcc on Windows
SVN revision: 78495
2012-10-25 22:01:28 +00:00
Tom Hacohen 5b9449c540 Efl eo: Fixed compilation warnings.
SVN revision: 78365
2012-10-23 09:56:39 +00:00
Vincent Torri 77d90bd45e merge: pass directly to the preprocessor the Windows macro instead of using autotools
SVN revision: 78350
2012-10-23 05:43:57 +00:00
Sebastian Dransfeld 616e6b4a6a efl: patch from eobj
port r77631
fix eo on 64bit.. bad valist fun

SVN revision: 77637
2012-10-09 11:34:16 +00:00
Tom Hacohen 4aa928b9c0 EFL-Eo: Added -DNDEBUG by default.
SVN revision: 77608
2012-10-09 03:02:22 +00:00
Vincent Torri 7fe3d35994 merge: __UNUSED__ --> EINA_UNUSED and some fixes in eo.
SVN revision: 77542
2012-10-05 20:09:47 +00:00