diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-03-18 14:37:10 +0100 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-03-18 14:38:43 +0100 |
commit | b1edfa61491e5d82809e2fc376954b7de938bbb2 (patch) | |
tree | c83497a8f6293856f3bc6232972e4b6389c6960a | |
parent | acdacefeb3661675b9927c04aa2016ba7f409f63 (diff) | |
download | efl-devs/bu5hm4n/work_eo.tar.gz |
-rw-r--r-- | src/lib/eo/eo.c | 35 | ||||
-rw-r--r-- | src/lib/eo/eo_private.h | 1 |
2 files changed, 6 insertions, 30 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index f7ce233d1e..94cc5e91e0 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -90,7 +90,6 @@ static _Efl_Class **_eo_classes = NULL; static Eo_Id _eo_classes_last_id = 0; static Eo_Id _eo_classes_alloc = 0; static int _efl_object_init_count = 0; -static Efl_Object_Op _eo_ops_last_id = 0; static Eina_Hash *_ops_storage2 = NULL; static Eina_Spinlock _ops_storage_lock; @@ -119,36 +118,17 @@ static inline Efl_Object_Op _efl_object_api_op_id_get_internal2(const void *api_ (_eo_classes[_UNMASK_ID(id) - 1]) : NULL); \ }) -/* XXX: Only used for a debug message below. Doesn't matter that it's slow. */ +#define EFL_OBJECT_OP_CLASS_PART(op) op >> 16 +#define EFL_OBJECT_OP_FUNC_PART(op) op & 0xffff +#define EFL_OBJECT_OP_CREATE_OP_ID(class_id, func_id) ((unsigned short)class_id)<<16|((unsigned short)func_id&0xffff) + static const _Efl_Class * _eo_op_class_get(Efl_Object_Op op) { - _Efl_Class **itr = _eo_classes; - int mid, max, min; - - min = 0; - max = _eo_classes_last_id - 1; - while (min <= max) - { - mid = (min + max) / 2; - - if (itr[mid]->base_id + itr[mid]->ops_count < op) - min = mid + 1; - else if (itr[mid]->base_id > op) - max = mid - 1; - else - return itr[mid]; - } - - return NULL; + short class_id = EFL_OBJECT_OP_CLASS_PART(op); + return _eo_classes[class_id]; } -// - -#define EFL_OBJECT_OP_CLASS_PART(op) op >> 16 -#define EFL_OBJECT_OP_FUNC_PART(op) op & 0xffff -#define EFL_OBJECT_OP_CREATE_OP_ID(class_id, func_id) ((unsigned short)class_id)<<16|((unsigned short)func_id&0xffff) - /** * This inits the vtable wit hthe current size of allocated tables */ @@ -880,11 +860,9 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ klass->ops_count = object_ops->count; - klass->base_id = _eo_ops_last_id; klass->base_id2 = _UNMASK_ID(klass->header.id) - 1; hitmap = alloca(sizeof(Eina_Bool) * klass->base_id2); memset(hitmap, 0, sizeof(Eina_Bool) * klass->base_id2); - _eo_ops_last_id += klass->ops_count + 1; _vtable_init(&klass->vtable2); @@ -2373,7 +2351,6 @@ efl_object_init(void) _eo_classes = NULL; _eo_classes_last_id = EO_CLASS_IDS_FIRST - 1; - _eo_ops_last_id = EFL_OBJECT_OP_IDS_FIRST; _eo_log_dom = eina_log_domain_register(log_dom, EINA_COLOR_LIGHTBLUE); if (_eo_log_dom < 0) { diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h index 8b456e612a..a032c229f3 100644 --- a/src/lib/eo/eo_private.h +++ b/src/lib/eo/eo_private.h @@ -189,7 +189,6 @@ struct _Efl_Class } iterators; unsigned int obj_size; /**< size of an object of this class */ - unsigned int base_id; unsigned int base_id2; unsigned int data_offset; /* < Offset of the data within object data. */ unsigned int ops_count; /* < Offset of the data within object data. */ |