static void _eo_destructor(Eo *obj, const Eo_Class *klass);
static void eo_constructor_error_unset(Eo *obj);
static inline void *_eo_data_get(const Eo *obj, const Eo_Class *klass);
+static inline Eo *_eo_ref(Eo *obj);
+static inline void _eo_unref(Eo *obj);
typedef struct _Eo_Callback_Description Eo_Callback_Description;
EO_MAGIC_RETURN_VAL(obj, EO_EINA_MAGIC, EINA_FALSE);
- eo_ref(obj);
+ _eo_ref(obj);
va_start(p_list, constant);
va_end(p_list);
- eo_unref(obj);
+ _eo_unref(obj);
return ret;
}
eo_constructor_error_unset(obj);
EINA_MAGIC_SET(obj, EO_EINA_MAGIC);
- eo_ref(obj);
+ _eo_ref(obj);
_eo_constructor(obj, klass);
if (EINA_UNLIKELY(eo_constructor_error_get(obj)))
goto fail;
}
_eo_kls_itr_end(obj, &prev_state);
- eo_unref(obj);
+ _eo_unref(obj);
return obj;
fail:
_eo_kls_itr_end(obj, &prev_state);
/* Unref twice, once for the ref above, and once for the basic object ref. */
- eo_unref(obj);
- eo_unref(obj);
+ _eo_unref(obj);
+ _eo_unref(obj);
return NULL;
}
{
EO_MAGIC_RETURN_VAL(obj, EO_EINA_MAGIC, obj);
- eo_ref(obj);
+ _eo_ref(obj);
#ifndef NDEBUG
Eo_Xref_Node *xref = calloc(1, sizeof(*xref));
#else
(void) ref_obj;
#endif
- eo_unref(obj);
+ _eo_unref(obj);
+}
+
+static inline Eo *
+_eo_ref(Eo *obj)
+{
+ obj->refcount++;
+ return obj;
}
EAPI Eo *
{
EO_MAGIC_RETURN_VAL(obj, EO_EINA_MAGIC, obj);
- obj->refcount++;
- return obj;
+ return _eo_ref(obj);
}
static void
}
}
-EAPI void
-eo_unref(Eo *obj)
+static inline void
+_eo_unref(Eo *obj)
{
- EO_MAGIC_RETURN(obj, EO_EINA_MAGIC);
-
if (--(obj->refcount) == 0)
{
_eo_del_internal(obj);
}
}
+EAPI void
+eo_unref(Eo *obj)
+{
+ EO_MAGIC_RETURN(obj, EO_EINA_MAGIC);
+
+ _eo_unref(obj);
+}
+
EAPI int
eo_ref_get(const Eo *obj)
{
EO_MAGIC_RETURN(obj, EO_EINA_MAGIC);
_eo_del_internal(obj);
- eo_unref(obj);
+ _eo_unref(obj);
}
EAPI Eo *
Eina_Bool ret = EINA_TRUE;
Eo_Callback_Description *cb;
- eo_ref(obj);
+ _eo_ref(obj);
obj->walking_list++;
EINA_INLIST_FOREACH(obj->callbacks, cb)
}
obj->walking_list--;
_eo_callbacks_clear(obj);
- eo_unref(obj);
+ _eo_unref(obj);
return ret;
}