efl/src/tests/eo/suite
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
..
CMakeLists.txt cmake: add eo 2017-01-23 20:02:06 +01:00
eo_error_msgs.c
eo_error_msgs.h
eo_suite.c ifdef RUN_IN_TREE logic. 2017-02-03 12:36:38 -02:00
eo_suite.h eo: add testcase to check emission of events 2016-12-02 12:27:37 +01:00
eo_test_call_errors.c eo: introduce function definitions with fallback 2017-09-29 11:00:37 +02:00
eo_test_class_behaviour_errors.c eo: Add class name to error log (unref) 2017-09-13 09:57:05 +09:00
eo_test_class_errors.c Eo: Change the way functions are registered to classes 2016-09-09 11:14:35 +01:00
eo_test_class_simple.c eo: Add API efl_data_scope_safe_get 2017-06-14 16:54:11 +09:00
eo_test_class_simple.h eo: Add API efl_data_scope_safe_get 2017-06-14 16:54:11 +09:00
eo_test_class_singleton.c Eo: Change the way functions are registered to classes 2016-09-09 11:14:35 +01:00
eo_test_class_singleton.h Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
eo_test_domain.c Eo: Change the way functions are registered to classes 2016-09-09 11:14:35 +01:00
eo_test_domain.h eo domain tests - make a start on them with some basic ones 2016-09-08 18:39:38 +09:00
eo_test_event.c eo: ensure the generation is correctly clamped 2017-02-16 13:37:19 -08:00
eo_test_general.c eo: Add beta API for auto_unref after a call 2017-10-18 11:02:16 +09:00
eo_test_init.c Eo tests: Adjust according to latest commit. 2016-12-07 13:31:54 +00:00
eo_test_threaded_calls.c tests: Remove CPU affinity from all threads 2017-03-06 17:03:47 +09:00
eo_test_value.c Eo: Finish the renaming of Eo to the EFL. 2016-08-15 15:07:42 +01:00