diff options
author | Tom Hacohen <tom@stosb.com> | 2015-11-09 11:45:04 +0000 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2016-03-01 14:18:11 +0000 |
commit | 74304319e43f00ac72a79080f7ee98dd7a6a622a (patch) | |
tree | 85d9db5b40a91589d1f99d26cec31cf218587aab | |
parent | 229d1bc5269def1c54257cd5671fa40ae987ca1a (diff) | |
download | efl-74304319e43f00ac72a79080f7ee98dd7a6a622a.tar.gz |
BLA
-rw-r--r-- | src/lib/eo/Eo.h | 22 | ||||
-rw-r--r-- | src/lib/eo/eo.c | 76 |
2 files changed, 11 insertions, 87 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index cfabd74c9a..03e6f57975 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -568,10 +568,10 @@ EAPI Eo_Op _eo_api_op_id_get(const void *api_func); EAPI Eina_Bool _eo_call_resolve(const char *func_name, Eo_Op_Call_Data *call, Eo_Call_Cache *callcache, const char *file, int line); // start of eo_do barrier, gets the object pointer and ref it, put it on the stask -EAPI Eina_Bool _eo_do_start(const Eo *obj, const Eo_Class *cur_klass, Eina_Bool is_super, void *eo_stack); +EAPI Eina_Bool _eo_do_start(const Eo *eo_id); // end of the eo_do barrier, unref the obj, move the stack pointer -EAPI void _eo_do_end(void *eo_stack); +EAPI void _eo_do_end(const Eo *eo_id); // end of the eo_add. Calls finalize among others EAPI Eo * _eo_add_end(void *eo_stack); @@ -583,16 +583,16 @@ EAPI EINA_CONST void *_eo_stack_get(void); #define _eo_do_common(eoid, clsid, is_super, ...) \ do { \ - _eo_do_start(eoid, clsid, is_super, _eo_stack_get()); \ + _eo_do_start(eoid); \ __VA_ARGS__; \ - _eo_do_end(_eo_stack_get()); \ + _eo_do_end(eoid); \ } while (0) #define _eo_do_common_ret(eoid, clsid, is_super, ret_tmp, func) \ ( \ - _eo_do_start(eoid, clsid, is_super, _eo_stack_get()), \ + _eo_do_start(eoid), \ ret_tmp = func, \ - _eo_do_end(_eo_stack_get()), \ + _eo_do_end(eoid), \ ret_tmp \ ) @@ -624,12 +624,12 @@ EAPI EINA_CONST void *_eo_stack_get(void); EAPI const Eo_Class *eo_class_get(const Eo *obj); #define _eo_add_common(klass, parent, is_ref, ...) \ - ( \ - _eo_do_start(_eo_add_internal_start(__FILE__, __LINE__, klass, parent, is_ref), \ - klass, EINA_FALSE, _eo_stack_get()) \ + ({ \ + const Eo *eoid = _eo_add_internal_start(__FILE__, __LINE__, klass, parent, is_ref); \ + _eo_do_start(eoid) \ , ##__VA_ARGS__, \ - (Eo *) _eo_add_end(_eo_stack_get()) \ - ) + (Eo *) _eo_add_end(eoid) \ + }) /** * @def eo_add diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 6baa7e90ae..0e7a5e90a0 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -439,82 +439,6 @@ _eo_call_stack_resize(Eo_Call_Stack *stack, Eina_Bool grow) stack->shrink_frame = &stack->frames[frame_offset]; } -static inline Eina_Bool -_eo_do_internal(const Eo *eo_id, const Eo_Class *cur_klass_id, - Eina_Bool is_super, Eo_Stack_Frame *fptr) -{ - fptr->is_obj = _eo_is_a_obj(eo_id); - - /* If we are already in the same object context, we inherit info from it. */ - if (fptr->is_obj) - { - EO_OBJ_POINTER_RETURN_VAL(eo_id, _obj, EINA_FALSE); - fptr->o.obj = _obj; - _eo_ref(_obj); - } - else - { - EO_CLASS_POINTER_RETURN_VAL(eo_id, _klass, EINA_FALSE); - fptr->o.kls = _klass; - } - - if (is_super) - { - EO_CLASS_POINTER_RETURN_VAL(cur_klass_id, cur_klass, EINA_FALSE); - fptr->cur_klass = cur_klass; - } - else - { - fptr->cur_klass = NULL; - } - - return EINA_TRUE; -} - -EAPI Eina_Bool -_eo_do_start(const Eo *eo_id, const Eo_Class *cur_klass_id, Eina_Bool is_super, void *eo_stack) -{ - Eina_Bool ret = EINA_TRUE; - Eo_Stack_Frame *fptr; - Eo_Call_Stack *stack = eo_stack; - - if (stack->frame_ptr == stack->last_frame) - _eo_call_stack_resize(stack, EINA_TRUE); - - fptr = stack->frame_ptr; - - fptr++; - - if (!_eo_do_internal(eo_id, cur_klass_id, is_super, fptr)) - { - fptr->o.obj = NULL; - fptr->cur_klass = NULL; - - ret = EINA_FALSE; - } - - stack->frame_ptr++; - - return ret; -} - -EAPI void -_eo_do_end(void *eo_stack) -{ - Eo_Stack_Frame *fptr; - Eo_Call_Stack *stack = eo_stack; - - fptr = stack->frame_ptr; - - if (fptr->is_obj && fptr->o.obj) - _eo_unref(fptr->o.obj); - - stack->frame_ptr--; - - if (fptr == stack->shrink_frame) - _eo_call_stack_resize(stack, EINA_FALSE); -} - EAPI Eina_Bool _eo_call_resolve(const char *func_name, Eo_Op_Call_Data *call, Eo_Call_Cache *cache, const char *file, int line) { |