From 72adab722226b664ce0b63be46650874cd8b0ef9 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 18 May 2016 23:02:09 +0900 Subject: [PATCH] eo datarefcount - only use in debug mode --- src/lib/eo/eo.c | 5 +++-- src/lib/eo/eo_private.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index c8039f4..e11ef13 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -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); if (data == NULL) return NULL; } - (obj->datarefcount)++; #ifdef EO_DEBUG + (obj->datarefcount)++; Eo_Xref_Node *xref = calloc(1, sizeof(*xref)); xref->ref_obj = _eo_obj_id_get(ref_obj); 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); } #else + (void) obj; (void) data; #endif +#ifdef EO_DEBUG 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); @@ -1504,7 +1506,6 @@ _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj) { (obj->datarefcount)--; } -#ifdef EO_DEBUG Eo_Xref_Node *xref = NULL; EINA_INLIST_FOREACH(obj->data_xrefs, xref) { diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h index e448bbd..a05bdf6 100644 --- a/src/lib/eo/eo_private.h +++ b/src/lib/eo/eo_private.h @@ -99,7 +99,9 @@ struct _Eo_Object Eo_Del_Intercept del_intercept; short refcount; +#ifdef EO_DEBUG short datarefcount; +#endif Eina_Bool condtor_done:1; Eina_Bool finalized:1; -- 2.7.4