efl/src/tests
Jean-Philippe Andre df304d0155 eo: Add beta API for auto_unref after a call
Before screaming in horror (C++...) here's why we may need this:
Efl.Part.part API returns an object that is by definition valid for a
single function call only. Enforcing this in practice is actually quite
hard as all implementation functions must manually take care of the
life-cycle. This is a lot of code in many places and a lot of
opportunities to forget to properly handle that life-cycle. Also, this
means any invalid function call on a part will leak an object.

This API absolutely must remain either "internal" or "beta" and
definitely not become abused by applications. On top of that such an API
can cause great trouble for bindings like C++. As a consequence, only
specially crafted APIs like efl_part() should return an object marked as
auto_unref.

Alternatively this API could be defined in Eo.h or some other
Eo_Internal.h. I placed it in efl_object.eo because it's much more
convenient :) (read: I'm lazy)

****

Performance notes:

Tested with clang & gcc (with -O2), I had a look at the output of perf
top, in particular the asm view. I used eo_bench in a loop. My
conclusions are:

- EINA_LIKELY/UNLIKELY actually works. The jump statement varies
  according to the expectation. I highly doubt all those ugly goto in
  eo.c / Eo.h are even useful.

- The impact of auto_unref on a call_resolve is so small it doesn't even
  appear in the trace. It is significant inside call_end, though
  (obviously, that function is just a few lines long). That function
  accounts for ~1% to ~4% of all CPU time. The impact of auto_unref in
  call_end is ~4% of the function time. This means ~0.16% of all CPU
  time (worst measured case). _efl_object_op_api_id_get simply doesn't
  show up because of caching, so the extra check there is negligible.

PS: I also tested EINA_LIKELY/UNLIKELY by compiling with -O2 and looking
at the output with objdump. The flag is well respected, and the jump
instructions are what you would expect (no jump for LIKELY and jump for
UNLIKELY). Conclusion: The goto's in eo.c only make the code harder to
read...
2017-10-18 11:02:16 +09:00
..
ecore ecore: Avoid using newer check.h functions. 2017-09-22 09:57:06 +02:00
ecore_audio_cxx eolian-cxx: Remove .Base requirement 2016-04-21 18:31:53 -03:00
ecore_con EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
ecore_cxx cxx: follow EINA_ERROR_OUT_OF_MEMORY deprecation 2016-09-05 10:39:24 +02:00
ector ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
edje edje: Fix make check 2017-10-13 11:07:28 +09:00
edje_cxx tests cxx: remove superfluous output to stdout 2016-03-02 15:32:09 +01:00
eet ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
eet_cxx Test rework #6: Eet_Cxx 2016-02-16 12:41:06 +00:00
eeze ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
efl ecore: Add efl_model_copmosite_selection model 2017-09-07 14:23:51 +09:00
efl_js efl_js: Update after eo/efl api changes 2016-10-25 12:23:34 -02:00
efreet ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
eina eina: this was actually a used variable. 2017-10-13 12:58:01 -07:00
eina_cxx eo-cxx: Require instantiate keyword for constructors calling efl_add to avoid ambiguity 2017-09-08 11:47:29 +09:00
eio eio: migrate efl.io.manager.ls to use Eina_Future. 2017-09-28 18:31:34 -07:00
eldbus eldbus: Fix test case (make check) 2017-09-19 16:53:25 +09:00
eldbus_cxx tests/eldbus_cxx: add ecore_init calls in tests now that eldbus does no longer 2016-04-12 16:55:48 +02:00
elementary elm: move the focus direction definition to general 2017-10-10 19:28:48 +02:00
elementary_cxx tests: elm_cxx: add gitignore file for produced binary 2017-07-11 22:55:28 +02:00
elocation ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
elput ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
elua ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
emile ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
emotion efl: Use Eina.Size2D for Efl.Gfx.size 2017-09-18 13:34:50 +09:00
eo eo: Add beta API for auto_unref after a call 2017-10-18 11:02:16 +09:00
eo_cxx eo-cxx: Add progress to future and promise 2016-09-20 23:30:29 -03:00
eolian eolian: fix setter generation for @auto functions 2017-10-13 23:49:57 +02:00
eolian_cxx eolian-cxx: Add optional parameter to lambda for unnamed proxy instantiation 2017-09-28 17:50:14 -03:00
eolian_js eolian cxx/js: fix test eo file ownership 2017-09-15 17:10:41 +02:00
evas efl: Use Eina.Size2D in Gfx.View 2017-09-19 10:51:48 +09:00
evas_cxx tests cxx: remove superfluous output to stdout 2016-03-02 15:32:09 +01:00
evil ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
.gitignore efl-js: JavaScript Eolian binding 2015-12-23 23:59:40 -02:00
efl_check.h efl: add helper to run tests suite under valgrind. 2016-12-21 16:40:22 -08:00