path: root/src/lib/eo/eo_base_class.c (follow)
AgeCommit message (Collapse)Author
2019-12-11eo: only forward event if someone is listening.Cedric BAIL
This limit long chain of useless event forwarding when nobody is listening at the end of the pipe. Differential Revision:
2019-11-20eo: there is no need to count callbacks hereMarcel Hollerbach
we are going to add this description anyways, no need to count here again. I think this is not really making anything really faster, its more keeping things consistance. Reviewed-by: Cedric BAIL <> Differential Revision:
2019-11-17eo: do not over compute the hash when propagating events.Cedric BAIL
This should slightly improve speed in theory. In practice, I have not seen a benchmark which would budge by 5%, so I am not sure it improve speed that much. Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-11-17eo: no need to oversize type.Cedric BAIL
Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-11-17eo: refactor shortcut for EFL_EVENT_DESTRUCT event.Cedric BAIL
Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-11-14eo: fix UB in the eo event code (edje_cc hangs etc.)Daniel Kolesa
Today I started experiencing mysterious hanging of edje_cc during build. "The French are at it again" I thought, and after spending a while bisecting, I found the culprit. It's 7f53d9158395504151e1ff3dcae715a799d913a8. So, what is happening in here? The idea here was fundamentally sound; compute a special hash value for event descriptors, taking range between 0 and 63 (on 64-bit systems) and 0 and 31 (on 32-bit systems), then use a mask sized 32-bit or 64-bit (depending on your system) and check early if to bail out from callback_call, saving some resources. So far so good. The problem is in the way the mask is handled. We're applying the hash as the shift value like, `x |= (1 << hash)`. On 32-bit systems this is okay, but on 64-bit systems, C's dumb silent coercion rules kick in, since the left side of the expression is 1, a literal with type signed int; that means our shifting range is limited to 31 and what we get is... undefined behavior. This is obviously not what we want, so take a 1ULL value as a base. The previous thing seemingly worked on x86_64 (nobody reported any issues) and interestingly it worked for me too for a while (on ppc64le), but undefined behavior can be unpredictable, so... This shouldn't need a commit message as long as this, but I'm making it proportional to the amount of time I wasted on this.
2019-11-07eo: make sure to return the right value for efl_event_callback_call.Cedric BAIL
EINA_FALSE is to be returned only if one of the callback did call efl_event_callback_stop not if their was no callback called. Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-10-31eo_base_class: move shift init to the first callMarcel Hollerbach
Summary: this cannot be evalulated in compile time, so this must be evalulated in runtime, at the first call. This should fix OSX build. Co-authored-by: Cedric Bail <> Reviewers: zmike, cedric, raster Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision:
2019-10-31eo: add debug ability to detect long chain of event handler.Cedric Bail
Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-10-31eo: reduce memory use to track event registration and callback call.Cedric Bail
Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-10-31eo: add infrastructure to attach an Eina_Future_Scheduler to any source of ↵Cedric Bail
event. Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-10-31ecore: remove unecessary field in data structure.Cedric Bail
Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-10-31eo: prevent unecessary callback call walk.Cedric Bail
This patch introduce a small hash (64 or 32bits) that cache all existing Efl_Event_Description callback handler registered on an object. It slightly reduce the time needed to do an unecessary call and cost just a few bytes per object. Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-10-14eo: block "invalidate" event emission when there are no subscribersMike Blumenkrantz
Summary: this should be handled like the rest of eo internal events ref T8321 Depends on D10353 Reviewers: bu5hm4n, cedric Reviewed By: bu5hm4n, cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8321 Differential Revision:
2019-09-19eo: custom created legacy events should be unfreezableMarcel Hollerbach
a while back we have moved event submission from custom lists to eo events. We also merged together the freeze and thaw functions, however, this brought up one bug. smart_callbacks and the likes (those that used custom lists before) are not effected by the legacy freeze and thaw functions. This means, we should declare these legacy wrapper objects unfreezable in order to obtain this behaviour. Reviewed-by: Cedric BAIL <> Reviewed-by: SangHyeon Jade Lee <> Differential Revision:
2019-07-17eo: add ability to register provider on the Eo object directly.Cedric BAIL
This should reduce the need for custom implementation of efl_object_provider_bind. It also enable the ability to register provider from user code on any Efl_Object. Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-05-29eo: add events to track the ownership status of an Eo objectVitor Sousa
Some user code may want to track an object ownership in regard to whether it is kept by just one owner or shared between many owners. This is specially true for code provided by bindings to other programming languages, where different kinds of resource management may take place. The event `ownership,unique` is triggered whenever the object refcount goes from two to one, as a signal that it has just one owner from now on. The event `ownership,shared` is triggered whenever the object refcount goes from one to two, as a signal that it has multiple owners from now on. It will not trigger when further increasing the refcount to any value beyond two. We also add benchmarks for sharing (i.e. increasing the refcount) and them unsharing objects, in order to evaluate the performance impact of this patch. Reviewed-by: Cedric BAIL <> Differential Revision:
2019-03-01eo: improve error message by giving an idea where the error come from.Cedric BAIL
Reviewed-by: Vitor Sousa da Silva <> Differential Revision:
2019-02-13eolian: drop class function overridingMarcel Hollerbach
Until this commit eo did class functions as part of the vtable, which enabled those functions to be overwritten in classes inheriting another class. However in task T7675 we decided that this is not really good for bindings, as most OOP languages do not support this sort of feature. After this commit eolian realizes class function completly outside of the vtable, the c-symbol that is the class funciton is now just directly redirecting to a implementation, without the involvement of the vtable. This also means a change to the syntax created by eo: Calling before: class_function(CLASS_A); Calling after: class_function(); Implementation before: class_function(const Eo *obj, void *pd) { ... } Implementation after: class_function(void) { ... } This fixes T7675. Co-authored-by: lauromauro <> Reviewed-by: Daniel Kolesa <> Differential Revision:
2019-01-24eo: propagate knowledge of EFL_EVENT_NOREF callback registration to the ↵Cedric BAIL
event call generation. This reduce the amount of time efl_event_callback_call(EFL_EVENT_NOREF) is triggered by a factor of 10. Reviewed-by: Derek Foreman <> Differential Revision:
2019-01-24eo: remove EFL_EVENT_SPECIAL_SKIP.Cedric BAIL
EFL_EVENT_SPECIAL_SKIP has been defined to 1 for a long time and there wasn't a way to disable it at all. There is no reason to not use it at all, so here we go. This was default, now it is without useless code. Reviewed-by: Derek Foreman <> Reviewed-by: Xavi Artigas <> Differential Revision:
2019-01-24eo: remove function efl_noref that duplicate EFL_EVENT_NOREF.Cedric BAIL
efl_noref is unused, but will still trigger the full eo call for nothing. This was the most expensive NOOP. EFL_EVENT_NOREF does the same thing and we can even filter generating that call as we know when someone is listening. So removing the function. Reviewed-by: Derek Foreman <> Reviewed-by: Xavi Artigas <> Differential Revision:
2019-01-02eo: enable priority with event forwarder.Cedric BAIL
Note: Their isn't any ability to do something like a static array of events at the moment. It might lead to large memory being used when it wouldn't be necessary. If that was the case, we could fix it, but it would require a lot of dynamic hash operation I think. Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-01-02eo: correctly allow for triggering the same event while the previous one was ↵Cedric BAIL
cancelled. If you are to trigger an event and just cancelled the one being processed, it would just not propagate any event while it should. The code looks like more like it was forgotten line or something. Reviewed-by: Marcel Hollerbach <> Differential Revision:
2018-12-07eo: make efl_future_then have a data pointer in addition of the object pointer.Cedric BAIL
Summary: In the case when you have multiple future in flight related to one object, you couldn't use the previous version of efl_future_then. Now all function calls take a void* pointer that allow multiple future to have their private data request data accessible in all the callback. This should not break released API as Eo.h is not released yet and so was efl_future_Eina_FutureXXX_then. Depends on D7332 Reviewers: felipealmeida, segfaultxavi, vitor.sousa, SanghyeonLee, bu5hm4n Reviewed By: segfaultxavi Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7472 Differential Revision:
2018-09-21eo: Add null checkJunsuChoi
Summary: This commit add null check on _efl_object_invalidate In EO_OBJ_POINTER, if obj_id is null, obj can also be null. Test Plan: N/A Reviewers: cedric, zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision:
2018-08-20efl_object: add call for getting invalidatingMarcel Hollerbach
Summary: there is now invalidated & invalidating. invalidated returns true when all children are invalidated, and the object is / was requested to be invalidated. invalidating return true when the object is called to be invalidated but not all children are invalidated yet. However, the object is garanteed to be invalidated in near future. Reviewers: zmike Reviewed By: zmike Subscribers: cedric Tags: #efl, #do_not_merge Differential Revision:
2018-07-05eo/base_class: explicitly refuse to set an object as its own parentMike Blumenkrantz
somehow this has been possible until now. no. @fix Differential Revision:
2018-06-25eo: remove some erroneous mutex unlocks during base class parent_set errorsMike Blumenkrantz
recent changes added unlocks for these mutexes in some other places, so only do the unlocks where necessary fix T7020
2018-06-25eo: remove some erroneous mutex unlocks during base class parent_set errorsMike Blumenkrantz
recent changes added unlocks for these mutexes in some other places, so only do the unlocks where necessary fix T7020 Depends on D6356 Differential Revision:
2018-06-05eo: make noref also a special countMarcel Hollerbach
Summary: this brings down the first frame time from 2.0 sec. to something at 0.7 sec. ref T6983 Reviewers: zmike Reviewed By: zmike Subscribers: YOhoho, cedric, #committers, zmike Tags: #efl Maniphest Tasks: T6983 Differential Revision:
2018-05-28eo: do not return efl_invalidated true when its not trueMarcel Hollerbach
Summary: the object is invalidated AFTER the parent is lost, (thats what the doc says). Returning invalidated as true when the parent is still present is thus not correctly. Depends on D6222 Reviewers: cedric, zmike, JackDanielZ Subscribers: cedric, #committers, zmike Tags: #efl Differential Revision: Reviewed-by: Cedric BAIL <>
2018-05-24eo: an object is invalidated if it is invalidated or if any parent is ↵Cedric BAIL
2018-05-24eo: move wref set to NULL to append after last event.Cedric BAIL
Making wref disapear before the last event require additional work to use them during the FREE event. As I think we should introduce a wref that disapear after the invalidate state, it makes sense to move that to a later stage. Especially because their is no specific event related to them being set to NULL.
2018-05-24eo: allow efl_part during object invalidate.Cedric Bail
2018-05-24eo: remove parent_sink as this hack should not be necessary anymore.Cedric BAIL
2018-05-24eo: try to make efl_add and efl_add_ref refcounting sane in all case.Cedric BAIL
2018-05-24eo: actually enforcing the efl_parent_set code path is necessary to enforce ↵Cedric Bail
the predictability of the code path.
2018-05-24eo: as efl_del is not an Eo API call anymore, manually protect call with ↵Cedric Bail
2018-05-24eo: move destruction of the link with children to be always after invalidate.Cedric Bail
2018-05-24eo: propagate invalidate before destroying the link to the parent.Cedric Bail
2018-05-24eo: improve message for debugging life cycle issues.Cedric Bail
2018-05-24eo: efl_del should not be something anyone can override this can break so ↵Cedric BAIL
many things. Allowing override of efl_del allow for messing with object life cycle which can create problem for binding where an object was expected to be invalidated, but isn't really.
2018-05-24eo: actually during invalidating we already have an invalidated object.Cedric BAIL
Differential Revision:
2018-05-24eo: check for allow_parent_unref during efl_unref and silence warning.Cedric BAIL
Differential Revision:
2018-05-24eo: add an automatic fallback at the moment when efl_unref instead of ↵Cedric BAIL
efl_del is called. Differential Revision:
2018-05-24eo: optimize efl object reuse by limiting the amount of call to pointer ↵Cedric BAIL
translation. Differential Revision:
2018-05-24eo: prevent parenting to an already invalidated parent.Cedric BAIL
Differential Revision:
2018-05-24eo: only call efl_parent_set(NULL) at the end of invalidate if the object is ↵Cedric BAIL
not invalidating. Add also a comment to justify why we do force parent to NULL during invalidate. Differential Revision:
2018-05-24eo: improve error message by pointing to the class that is creating trouble.Cedric BAIL
Differential Revision: