forked from enlightenment/efl
eo datarefcount - only use in debug mode
This commit is contained in:
parent
55a6bd7fbb
commit
72adab7222
|
@ -1466,8 +1466,8 @@ _eo_data_xref_internal(const char *file, int line, _Eo_Object *obj, const _Eo_Cl
|
||||||
data = _eo_data_scope_safe_get(obj, klass);
|
data = _eo_data_scope_safe_get(obj, klass);
|
||||||
if (data == NULL) return NULL;
|
if (data == NULL) return NULL;
|
||||||
}
|
}
|
||||||
(obj->datarefcount)++;
|
|
||||||
#ifdef EO_DEBUG
|
#ifdef EO_DEBUG
|
||||||
|
(obj->datarefcount)++;
|
||||||
Eo_Xref_Node *xref = calloc(1, sizeof(*xref));
|
Eo_Xref_Node *xref = calloc(1, sizeof(*xref));
|
||||||
xref->ref_obj = _eo_obj_id_get(ref_obj);
|
xref->ref_obj = _eo_obj_id_get(ref_obj);
|
||||||
xref->file = file;
|
xref->file = file;
|
||||||
|
@ -1494,8 +1494,10 @@ _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj)
|
||||||
ERR("Data %p is not in the data range of the object %p (%s).", data, (Eo *)obj->headr.id, obj->klass->desc->name);
|
ERR("Data %p is not in the data range of the object %p (%s).", data, (Eo *)obj->headr.id, obj->klass->desc->name);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
(void) obj;
|
||||||
(void) data;
|
(void) data;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef EO_DEBUG
|
||||||
if (obj->datarefcount == 0)
|
if (obj->datarefcount == 0)
|
||||||
{
|
{
|
||||||
ERR("Data for object %zx (%s) is already not referenced.", (size_t)_eo_obj_id_get(obj), obj->klass->desc->name);
|
ERR("Data for object %zx (%s) is already not referenced.", (size_t)_eo_obj_id_get(obj), obj->klass->desc->name);
|
||||||
|
@ -1504,7 +1506,6 @@ _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj)
|
||||||
{
|
{
|
||||||
(obj->datarefcount)--;
|
(obj->datarefcount)--;
|
||||||
}
|
}
|
||||||
#ifdef EO_DEBUG
|
|
||||||
Eo_Xref_Node *xref = NULL;
|
Eo_Xref_Node *xref = NULL;
|
||||||
EINA_INLIST_FOREACH(obj->data_xrefs, xref)
|
EINA_INLIST_FOREACH(obj->data_xrefs, xref)
|
||||||
{
|
{
|
||||||
|
|
|
@ -99,7 +99,9 @@ struct _Eo_Object
|
||||||
Eo_Del_Intercept del_intercept;
|
Eo_Del_Intercept del_intercept;
|
||||||
|
|
||||||
short refcount;
|
short refcount;
|
||||||
|
#ifdef EO_DEBUG
|
||||||
short datarefcount;
|
short datarefcount;
|
||||||
|
#endif
|
||||||
|
|
||||||
Eina_Bool condtor_done:1;
|
Eina_Bool condtor_done:1;
|
||||||
Eina_Bool finalized:1;
|
Eina_Bool finalized:1;
|
||||||
|
|
Loading…
Reference in New Issue