forked from enlightenment/efl
eo - eoid - finally rtemove option to not have eoid. it doesn't work
we use too many bits for metadata now so eoid is broken... remove it as an option so people dont break out the foot guns
This commit is contained in:
parent
f603001367
commit
1d0b37a9e6
13
configure.ac
13
configure.ac
|
@ -2219,19 +2219,6 @@ AC_ARG_ENABLE([fribidi],
|
||||||
],
|
],
|
||||||
[want_fribidi="yes"])
|
[want_fribidi="yes"])
|
||||||
|
|
||||||
# Eo Id
|
|
||||||
AC_ARG_ENABLE([eo_id],
|
|
||||||
[AS_HELP_STRING([--disable-eo-id],[disable Eo indirection. @<:@default=enabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_eo_id="yes"
|
|
||||||
else
|
|
||||||
want_eo_id="no"
|
|
||||||
CFOPT_WARNING="xyes"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_eo_id="yes"])
|
|
||||||
|
|
||||||
# Harfbuzz
|
# Harfbuzz
|
||||||
AC_ARG_ENABLE([harfbuzz],
|
AC_ARG_ENABLE([harfbuzz],
|
||||||
[AS_HELP_STRING([--enable-harfbuzz],[enable complex text shaping and layouting support. @<:@default=disabled@:>@])],
|
[AS_HELP_STRING([--enable-harfbuzz],[enable complex text shaping and layouting support. @<:@default=disabled@:>@])],
|
||||||
|
|
|
@ -272,11 +272,7 @@ _vtable_func_clean_all(Eo_Vtable *vtable)
|
||||||
|
|
||||||
/* END OF DICH */
|
/* END OF DICH */
|
||||||
|
|
||||||
#ifdef HAVE_EO_ID
|
#define _EO_ID_GET(Id) ((Eo_Id) (Id))
|
||||||
# define _EO_ID_GET(Id) ((Eo_Id) (Id))
|
|
||||||
#else
|
|
||||||
# define _EO_ID_GET(Id) ((Eo_Id) ((Id) ? ((Eo_Header *) (Id))->id : 0))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static inline Eina_Bool
|
static inline Eina_Bool
|
||||||
|
@ -294,30 +290,9 @@ _eo_is_a_class(const Eo *eo_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline _Efl_Class *
|
static inline _Efl_Class *
|
||||||
_eo_class_pointer_get(const Efl_Class *klass_id, const char *func_name, const char *file, int line)
|
_eo_class_pointer_get(const Efl_Class *klass_id)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EO_ID
|
|
||||||
return ID_CLASS_GET((Eo_Id)klass_id);
|
return ID_CLASS_GET((Eo_Id)klass_id);
|
||||||
(void)func_name;
|
|
||||||
(void)file;
|
|
||||||
(void)line;
|
|
||||||
#else
|
|
||||||
Eo_Header *klass = (Eo_Header *)klass_id;
|
|
||||||
if (EINA_UNLIKELY(!klass))
|
|
||||||
{
|
|
||||||
eina_log_print(_eo_log_dom,
|
|
||||||
EINA_LOG_LEVEL_DBG,
|
|
||||||
file, func_name, line,
|
|
||||||
"klass_id is NULL. Possibly unintended access?");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (EINA_UNLIKELY(!EINA_MAGIC_CHECK(klass, EO_CLASS_EINA_MAGIC)))
|
|
||||||
{
|
|
||||||
eina_magic_fail(klass, klass->__magic, EO_CLASS_EINA_MAGIC, file, func_name, line);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return (_Efl_Class *) klass_id;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
|
@ -874,9 +849,6 @@ _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, E
|
||||||
obj->refcount++;
|
obj->refcount++;
|
||||||
obj->klass = klass;
|
obj->klass = klass;
|
||||||
|
|
||||||
#ifndef HAVE_EO_ID
|
|
||||||
EINA_MAGIC_SET((Eo_Header *) obj, EO_EINA_MAGIC);
|
|
||||||
#endif
|
|
||||||
obj->header.id = _eo_id_allocate(obj, parent_id);
|
obj->header.id = _eo_id_allocate(obj, parent_id);
|
||||||
Eo *eo_id = _eo_obj_id_get(obj);
|
Eo *eo_id = _eo_obj_id_get(obj);
|
||||||
|
|
||||||
|
@ -1379,7 +1351,7 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
|
||||||
|
|
||||||
if (parent_id)
|
if (parent_id)
|
||||||
{
|
{
|
||||||
parent = _eo_class_pointer_get(parent_id, __FUNCTION__, __FILE__, __LINE__);
|
parent = _eo_class_pointer_get(parent_id);
|
||||||
if (!parent)
|
if (!parent)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1431,7 +1403,7 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
|
||||||
extn_id = va_arg(p_list, Eo_Id *);
|
extn_id = va_arg(p_list, Eo_Id *);
|
||||||
while (extn_id)
|
while (extn_id)
|
||||||
{
|
{
|
||||||
extn = _eo_class_pointer_get((Efl_Class *)extn_id, __FUNCTION__, __FILE__, __LINE__);
|
extn = _eo_class_pointer_get((Efl_Class *)extn_id);
|
||||||
if (EINA_LIKELY(extn != NULL))
|
if (EINA_LIKELY(extn != NULL))
|
||||||
{
|
{
|
||||||
switch (extn->desc->type)
|
switch (extn->desc->type)
|
||||||
|
@ -1495,9 +1467,6 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
|
||||||
}
|
}
|
||||||
|
|
||||||
klass = calloc(1, _eo_class_sz + extn_sz + mro_sz + mixins_sz);
|
klass = calloc(1, _eo_class_sz + extn_sz + mro_sz + mixins_sz);
|
||||||
#ifndef HAVE_EO_ID
|
|
||||||
EINA_MAGIC_SET((Eo_Header *) klass, EO_CLASS_EINA_MAGIC);
|
|
||||||
#endif
|
|
||||||
eina_spinlock_new(&klass->objects.trash_lock);
|
eina_spinlock_new(&klass->objects.trash_lock);
|
||||||
eina_spinlock_new(&klass->iterators.trash_lock);
|
eina_spinlock_new(&klass->iterators.trash_lock);
|
||||||
klass->parent = parent;
|
klass->parent = parent;
|
||||||
|
|
|
@ -83,9 +83,6 @@ void _vtable_func_clean_all(Eo_Vtable *vtable);
|
||||||
|
|
||||||
struct _Eo_Header
|
struct _Eo_Header
|
||||||
{
|
{
|
||||||
#ifndef HAVE_EO_ID
|
|
||||||
EINA_MAGIC
|
|
||||||
#endif
|
|
||||||
Eo_Id id;
|
Eo_Id id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -224,11 +221,7 @@ void _efl_object_parent_sink_set(Eo *obj, Eina_Bool sink);
|
||||||
static inline
|
static inline
|
||||||
Eo *_eo_header_id_get(const Eo_Header *header)
|
Eo *_eo_header_id_get(const Eo_Header *header)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EO_ID
|
|
||||||
return (Eo *) header->id;
|
return (Eo *) header->id;
|
||||||
#else
|
|
||||||
return (Eo *) header;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Retrieves the pointer to the object from the id */
|
/* Retrieves the pointer to the object from the id */
|
||||||
|
|
|
@ -25,7 +25,6 @@ _eo_pointer_error(const Eo *obj_id, const char *func_name, const char *file, int
|
||||||
_eo_log_obj_report((Eo_Id)obj_id, EINA_LOG_LEVEL_ERR, func_name, file, line);
|
_eo_log_obj_report((Eo_Id)obj_id, EINA_LOG_LEVEL_ERR, func_name, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_EO_ID
|
|
||||||
static void
|
static void
|
||||||
_eo_obj_pointer_invalid(const Eo_Id obj_id,
|
_eo_obj_pointer_invalid(const Eo_Id obj_id,
|
||||||
Eo_Id_Data *data,
|
Eo_Id_Data *data,
|
||||||
|
@ -68,12 +67,10 @@ _eo_obj_pointer_invalid(const Eo_Id obj_id,
|
||||||
);
|
);
|
||||||
_eo_log_obj_report(obj_id, EINA_LOG_LEVEL_ERR, func_name, file, line);
|
_eo_log_obj_report(obj_id, EINA_LOG_LEVEL_ERR, func_name, file, line);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
_Eo_Object *
|
_Eo_Object *
|
||||||
_eo_obj_pointer_get(const Eo_Id obj_id, const char *func_name, const char *file, int line)
|
_eo_obj_pointer_get(const Eo_Id obj_id, const char *func_name, const char *file, int line)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EO_ID
|
|
||||||
_Eo_Id_Entry *entry;
|
_Eo_Id_Entry *entry;
|
||||||
Generation_Counter generation;
|
Generation_Counter generation;
|
||||||
Table_Index mid_table_id, table_id, entry_id;
|
Table_Index mid_table_id, table_id, entry_id;
|
||||||
|
@ -183,22 +180,4 @@ err_shared:
|
||||||
err:
|
err:
|
||||||
_eo_obj_pointer_invalid(obj_id, data, domain, func_name, file, line);
|
_eo_obj_pointer_invalid(obj_id, data, domain, func_name, file, line);
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
|
||||||
Eo_Header *obj = (Eo_Header *)obj_id;
|
|
||||||
if (EINA_UNLIKELY(!obj))
|
|
||||||
{
|
|
||||||
eina_log_print(_eo_log_dom,
|
|
||||||
EINA_LOG_LEVEL_DBG,
|
|
||||||
file, func_name, line,
|
|
||||||
"obj_id is NULL. Possibly unintended access?");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (EINA_UNLIKELY(!EINA_MAGIC_CHECK(obj, EO_EINA_MAGIC)))
|
|
||||||
{
|
|
||||||
eina_magic_fail(obj, obj->__magic, EO_EINA_MAGIC, file, func_name, line);
|
|
||||||
_eo_log_obj_report(obj_id, EINA_LOG_LEVEL_ERR, func_name, file, line);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return (_Eo_Object *) obj_id;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,14 +121,14 @@ void _eo_pointer_error(const Eo *obj_id, const char *func_name, const char *file
|
||||||
#define EO_CLASS_POINTER_GOTO(klass_id, klass, label) \
|
#define EO_CLASS_POINTER_GOTO(klass_id, klass, label) \
|
||||||
_Efl_Class *klass; \
|
_Efl_Class *klass; \
|
||||||
do { \
|
do { \
|
||||||
klass = _eo_class_pointer_get(klass_id, __FUNCTION__, __FILE__, __LINE__); \
|
klass = _eo_class_pointer_get(klass_id); \
|
||||||
if (!klass) goto label; \
|
if (!klass) goto label; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define EO_CLASS_POINTER_GOTO_PROXY(klass_id, klass, label) \
|
#define EO_CLASS_POINTER_GOTO_PROXY(klass_id, klass, label) \
|
||||||
_Efl_Class *klass; \
|
_Efl_Class *klass; \
|
||||||
do { \
|
do { \
|
||||||
klass = _eo_class_pointer_get(klass_id, func_name, file, line); \
|
klass = _eo_class_pointer_get(klass_id); \
|
||||||
if (!klass) goto label; \
|
if (!klass) goto label; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
|
@ -358,12 +358,9 @@ _eo_id_domain_compatible(const Eo *o1, const Eo *o2)
|
||||||
static inline void
|
static inline void
|
||||||
_eo_obj_pointer_done(const Eo_Id obj_id)
|
_eo_obj_pointer_done(const Eo_Id obj_id)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EO_ID
|
|
||||||
Efl_Id_Domain domain = (obj_id >> SHIFT_DOMAIN) & MASK_DOMAIN;
|
Efl_Id_Domain domain = (obj_id >> SHIFT_DOMAIN) & MASK_DOMAIN;
|
||||||
if (EINA_LIKELY(domain != EFL_ID_DOMAIN_SHARED)) return;
|
if (EINA_LIKELY(domain != EFL_ID_DOMAIN_SHARED)) return;
|
||||||
eina_lock_release(&(_eo_table_data_shared_data->obj_lock));
|
eina_lock_release(&(_eo_table_data_shared_data->obj_lock));
|
||||||
#endif
|
|
||||||
(void)obj_id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -483,7 +480,6 @@ _search_tables(Eo_Id_Table_Data *tdata)
|
||||||
static inline Eo_Id
|
static inline Eo_Id
|
||||||
_eo_id_allocate(const _Eo_Object *obj, const Eo *parent_id)
|
_eo_id_allocate(const _Eo_Object *obj, const Eo *parent_id)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EO_ID
|
|
||||||
_Eo_Id_Entry *entry = NULL;
|
_Eo_Id_Entry *entry = NULL;
|
||||||
Eo_Id_Data *data;
|
Eo_Id_Data *data;
|
||||||
Eo_Id_Table_Data *tdata;
|
Eo_Id_Table_Data *tdata;
|
||||||
|
@ -555,17 +551,11 @@ shared_err:
|
||||||
eina_lock_release(&(_eo_table_data_shared_data->obj_lock));
|
eina_lock_release(&(_eo_table_data_shared_data->obj_lock));
|
||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
#else
|
|
||||||
(void) obj;
|
|
||||||
(void) parent_id;
|
|
||||||
return MASK_OBJ_TAG;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
_eo_id_release(const Eo_Id obj_id)
|
_eo_id_release(const Eo_Id obj_id)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EO_ID
|
|
||||||
_Eo_Ids_Table *table;
|
_Eo_Ids_Table *table;
|
||||||
_Eo_Id_Entry *entry;
|
_Eo_Id_Entry *entry;
|
||||||
Generation_Counter generation;
|
Generation_Counter generation;
|
||||||
|
@ -683,9 +673,6 @@ _eo_id_release(const Eo_Id obj_id)
|
||||||
eina_lock_release(&(_eo_table_data_shared_data->obj_lock));
|
eina_lock_release(&(_eo_table_data_shared_data->obj_lock));
|
||||||
}
|
}
|
||||||
ERR("obj_id %p is not pointing to a valid object. Maybe it has already been freed.", (void *)obj_id);
|
ERR("obj_id %p is not pointing to a valid object. Maybe it has already been freed.", (void *)obj_id);
|
||||||
#else
|
|
||||||
EINA_MAGIC_SET((Eo_Header *) obj_id, EO_FREED_EINA_MAGIC);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|
Loading…
Reference in New Issue