Jérémy Zurcher
0b97c11ea2
eo: improve error reporting, update tests
2014-05-08 13:44:47 +02:00
Jérémy Zurcher
0ce3154656
eo: improve error reporting for _eo_api_op_id_get()
2014-05-08 00:15:53 +02:00
Tom Hacohen
e699087521
Eo: fixed misleading indentation.
2014-05-01 13:28:30 +01:00
Carsten Haitzler
1ed6e2cf9c
improve eo call stack
...
it now does up to 8192 entries and madvise unused upper pages when
dropping. also delay dropping to avoi too many syscalls
2014-04-22 20:24:27 +09:00
Carsten Haitzler
f21cfc0554
eo - callstack. realloc is a bad idea. use mmap and keep addr fixed
...
this fixes and eo2 problem where when callstack grows (or shrinks)
and realloc nas to relocate memory, the frame ptrs like fptr become
invalid and all sorts of hell ensues.
this uses mmap so blowing the stack will segv, not scribble over
memory, also its separated from malloc heap, and now big enough to not
need to size ... ever (1024 entries).
2014-04-22 19:19:24 +09:00
Cedric Bail
cb43636bd1
eo: do not risk dereferencing NULL.
...
CID 1199563.
2014-04-17 21:10:34 +02:00
Carsten Haitzler
08484aa646
formatting fix (spacing)
2014-04-17 16:35:43 +09:00
Tom Hacohen
d77a7ce468
Eo: eo_do now returns called func's value + default ret fix.
...
It's now completely valid to do:
a = eo_do(obj, a_get());
or:
b = eo_do(obj, a_set(1), b_get());
Also, the default return value for eo2 functions is now also returned
when the object is invalid, not just when the object does not match
class.
It's a small refactor that fixed both issues at once.
@feature
@fix
2014-04-14 10:54:08 +01:00
Tom Hacohen
68a1f1941a
Eo: Fix class checking.
...
Without this patch, NULL, and random garbage are detected as classes.
This fixes is.
2014-04-14 10:54:08 +01:00
Daniel Zaoui
1a895149e7
Eo: fix warning on printf
2014-04-10 11:42:54 +03:00
Tom Hacohen
a77f090256
Eo2: Make internal function static + improved debug output.
2014-04-10 04:20:21 +01:00
Tom Hacohen
c32bb4fe95
Eo2: Updated naming Eo2->Eo.
2014-04-10 04:20:21 +01:00
Tom Hacohen
80faa56ed3
Eo2: Removed more Eo1 code.
2014-04-10 04:20:21 +01:00
Tom Hacohen
3c46e7dab8
Eo2: Removed a lot of Eo1 code.
2014-04-10 04:20:21 +01:00
Tom Hacohen
9d332da1f8
Eo2: Adjust to composite object changes.
2014-04-10 04:20:21 +01:00
Jérémy Zurcher
d39d705087
eo2: call stack is now thread safe
...
create/destroy tls key (_eo2_call_stack_key) at eo_init()/eo_shutdown().
use _eo2_call_stack_get() to allocate the stack when required.
register _eo2_call_stack_free() as eina_tls_cb_new() delete callback.
2014-04-10 04:20:21 +01:00
Jérémy Zurcher
f812b38a66
eo2: do not allow ill formed class creation
...
eo_class_new() returns NULL on error in _eo2_class_funcs_set().
it covers: NULL API func, API redefined, dich func override,
overriding non-existing fct.
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
70fe1398fd
eo2: if _eo2_class_funcs_set() fails eo_class_new() returns NULL
...
call to _eo2_class_funcs_set() is moved out of _eo_class_constructor()
into eo_class_new().
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
a0d761cfa9
eo2: _eo2_call_resolve() fails if op is EO_NOOP
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
9d2eeb7a8b
eo2: improve _eo2_class_funcs_set() errors support
...
as op descs are sorted, we can't output fct indexes in error msgs, but
as they are sorted using api_fct as key, we can detect multiple usage of
the same api_fct which leads to an unpredictable call to whatever is
returned by _eo2_api_op_id_get()->_eo2_api_desc_get().
it is still possible to instanciate an object of a not well defined class.
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
a9c325c124
eo2: normalize ERR msgs
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
c506ce2e1f
eo2: fix err msg in _dich_func_set()
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
82af591b83
eo2: improve _eo_op_id_name_get() to support eo1/2
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
19245b48f8
eo2: add _eo2_op_id_desc_get()
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
e41f2804b4
eo2: improve err msg in _eo2_api_op_id_get() and _eo2_call_resolve()
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
63c271dc5e
eo2: fix indentation
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
d3cd7cd63c
eo2: do not try to unref classes in eo2_do_end()
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
56ae6cf32e
eo2: remove memset() in _eo2_do_end() as all stack fields are set in _eo2_do_start()
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
adb5b8776d
eo2: no need to resolve eo_id when we reuse previous stack frame
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
ae536bdd84
eo2: call stack grows and shrinks
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
1834e3ff12
eo2: remove dead code
2014-04-10 04:20:20 +01:00
Tom Hacohen
0dc70153e5
eo2: optimize eo2_do_super func relove a bit.
...
no need to call dich_func_get twice, just reuse the value previously
fetched.
2014-04-10 04:20:20 +01:00
Tom Hacohen
08aca96bc3
eo2: get rid of eo2_stack_depth_get.
...
This is super internal, no reason why it should be exposed.
We should just implement automatic stack growth.
2014-04-10 04:20:20 +01:00
Tom Hacohen
2fe10219c0
eo2: prefixed internal functions with _.
...
This is done to prevent code completion from picking them up.
2014-04-10 04:20:19 +01:00
Tom Hacohen
ebae305a9e
eo2: fixed validity checks for eo2_do_super.
...
The class should be checked to be valid and non-null.
This fixes the issues with eo_suite.
2014-04-10 04:20:19 +01:00
Tom Hacohen
1890fdf27f
eo2: fixed eo2_do call order.
...
This fixes the mixin test and general calling order.
"Next class" can only be known per op. That's why super should be
restricted to only one op.
2014-04-10 04:20:19 +01:00
Tom Hacohen
d9ceddf63a
eo2: fixed formatting.
2014-04-10 04:20:19 +01:00
Tom Hacohen
b8ae43b464
eo2: prefix all the eo2_*internal* functions with an underscore.
...
This prevents them from being auto-completed by IDEs which makes
development nicer.
2014-04-10 04:20:19 +01:00
Tom Hacohen
a588c7d99e
eo2: correctly handle eo2_do(NULL, ...).
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
b08ae598a8
eo2: do not restrict search for api in class extensions to some class types
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
ca1f245366
eo2: _eo2_api_desc_get can look into interfaces extensions too
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
541cf25723
eo2: eo2_add_internal_end() return NULL if do_error is set
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
9c1856bf82
eo2: support NULL op_descs
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
11595dc40c
eo2: fix mixim elaboration
...
a mixin class must not inherit
- _eo2_api_desc_get()
accept NULL klass param
EO_CLASS_TYPE_REGULAR_NO_INSTANT is an acceptable extension class type for
- _eo2_class_funcs_set() do not shout if parent is NULL
2014-04-10 04:20:18 +01:00
Jérémy Zurcher
23e2c29298
eo2: remove EO2_CLASS_FUNC_* macros
...
there is no more difference in class or regular functions prototypes and definitions
- eo2_api_op_id_get() uses _eo_is_a_class() at runtime
- add 'void *class_data EINA_UNUSED' parameter to eo2_base class functions
- Eo2_Op_Call_Data.klass is kept only for eo2_hook_call_pre end eo2_hook_call_post,
but could be removed easily
2014-04-10 04:20:18 +01:00
Tom Hacohen
5e92ffb121
eo2: improved error messages on failed resolves.
2014-04-10 04:20:18 +01:00
Jérémy Zurcher
eb01d1c3e8
eo2: add EO2_CLASS_CLASS
2014-04-10 04:20:18 +01:00
Jérémy Zurcher
47d560b720
eo2: support composites object
...
_eo2_api_desc_get() searches extensions classes
eo2_call_resolve() searches composites objects
2014-04-10 04:20:18 +01:00
Jérémy Zurcher
2e9ae2a571
eo2: optimize eo2_call_resolve and call stack
2014-04-10 04:20:18 +01:00
Jérémy Zurcher
e51e397b89
eo2: fix eo_base_data_get(), eo_composite_attach(), eo_composite_detach()
2014-04-10 04:20:18 +01:00