eo: remove function efl_noref that duplicate EFL_EVENT_NOREF.
authorCedric BAIL <cedric.bail@free.fr>
Wed, 23 Jan 2019 23:33:01 +0000 (15:33 -0800)
committerTaehyub Kim <taehyub.kim@samsung.com>
Thu, 31 Jan 2019 01:53:44 +0000 (10:53 +0900)
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 <derekf@osg.samsung.com>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7742

src/lib/eo/efl_object.eo
src/lib/eo/eo.c
src/lib/eo/eo_base_class.c

index 6049ceb..f898e2b 100644 (file)
@@ -195,12 +195,6 @@ abstract Efl.Object
       invalidate {
          [[Called when parent reference is lost/set to $NULL and switch the state of the object to invalidate.]]
       }
-      noref {
-         [[Triggered when no reference are keeping the object alive.
-
-           The parent can be the last one keeping an object alive and so $noref can happen before $invalidate
-           as it is only impacted by the ref/unref of the object.]]
-      }
       name_find @const {
          [[Find a child object with the given name and return it.
 
index 82299fe..78bed1a 100644 (file)
@@ -1928,7 +1928,7 @@ efl_unref(const Eo *obj_id)
                      ((obj->user_refcount == 1 && !obj->parent) ||
                       (obj->user_refcount == 2 && obj->parent))))
      {
-        // We need to report efl_ref_count correctly during efl_noref, so fake it
+        // We need to report efl_ref_count correctly during EFL_EVENT_NOREF, so fake it
         // by adjusting efl_ref_count while inside efl_unref (This should avoid
         // infinite loop)
         obj->unref_compensate = EINA_TRUE;
@@ -1936,7 +1936,6 @@ efl_unref(const Eo *obj_id)
         // The noref event should happen before any object in the
         // tree get affected by the change in refcount.
         efl_event_callback_call((Eo *) obj_id, EFL_EVENT_NOREF, NULL);
-        efl_noref((Eo *) obj_id);
 
         obj->unref_compensate = EINA_FALSE;
      }
index ef3a1ba..bfe9eac 100644 (file)
@@ -189,11 +189,6 @@ _efl_invalidate(_Eo_Object *obj)
    obj->invalidate = EINA_TRUE;
 }
 
-static void
-_efl_object_noref(Eo *obj EINA_UNUSED, Efl_Object_Data *pd EINA_UNUSED)
-{
-}
-
 static inline void
 _efl_object_extension_free(Efl_Object_Extension *ext)
 {