summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2018-01-06 13:20:59 +0100
committerJean Guyomarc'h <jean@guyomarch.bzh>2018-01-06 13:20:59 +0100
commit97688b2fa5497790f532f425062844ad0c7949ea (patch)
tree965af2e84150eb045924c80b709f88d5596f6072
parent0f7c5582a4873711e0e086a8c725ffe899e29bcf (diff)
experimental: remove the EO ptr indirection
-rw-r--r--src/lib/eo/Eo.h16
-rw-r--r--src/lib/eo/eo.c100
-rw-r--r--src/lib/eo/eo_base_class.c21
-rw-r--r--src/lib/eo/eo_private.h20
-rw-r--r--src/lib/eo/eo_ptr_indirection.c2
-rw-r--r--src/lib/eo/eo_ptr_indirection.h9
-rw-r--r--src/lib/eo/eo_ptr_indirection.x7
7 files changed, 163 insertions, 12 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 3ea20ec2ff..cb4d064297 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -8,6 +8,8 @@
8# undef EAPI 8# undef EAPI
9#endif 9#endif
10 10
11#define EO_NO_PTR_INDIRECTION
12
11#define EOLIAN 13#define EOLIAN
12 14
13/* When used, this indicates that the function is an Eo API. */ 15/* When used, this indicates that the function is an Eo API. */
@@ -1240,6 +1242,12 @@ __##Name##_failed: \
1240#define _EFL_OBJECT_API_AFTER_HOOK 1242#define _EFL_OBJECT_API_AFTER_HOOK
1241#define _EFL_OBJECT_API_CALL_HOOK(x) x 1243#define _EFL_OBJECT_API_CALL_HOOK(x) x
1242 1244
1245#ifdef EO_NO_PTR_INDIRECTION
1246# define _EO_CALL_OBJ() (Eo*)___call.obj
1247#else
1248# define _EO_CALL_OBJ() ___call.eo_id
1249#endif
1250
1243// to define an EAPI function 1251// to define an EAPI function
1244#define _EFL_OBJECT_FUNC_BODY(Name, ObjType, Ret, DefRet, ErrorCase) \ 1252#define _EFL_OBJECT_FUNC_BODY(Name, ObjType, Ret, DefRet, ErrorCase) \
1245 Ret \ 1253 Ret \
@@ -1249,7 +1257,7 @@ __##Name##_failed: \
1249 Ret _r; \ 1257 Ret _r; \
1250 EFL_FUNC_COMMON_OP(obj, Name, DefRet); \ 1258 EFL_FUNC_COMMON_OP(obj, Name, DefRet); \
1251 _EFL_OBJECT_API_BEFORE_HOOK \ 1259 _EFL_OBJECT_API_BEFORE_HOOK \
1252 _r = _EFL_OBJECT_API_CALL_HOOK(_func_(___call.eo_id, ___call.data)); \ 1260 _r = _EFL_OBJECT_API_CALL_HOOK(_func_(_EO_CALL_OBJ(), ___call.data)); \
1253 _efl_object_call_end(&___call); \ 1261 _efl_object_call_end(&___call); \
1254 _EFL_OBJECT_API_AFTER_HOOK \ 1262 _EFL_OBJECT_API_AFTER_HOOK \
1255 return _r; \ 1263 return _r; \
@@ -1263,7 +1271,7 @@ __##Name##_failed: \
1263 typedef void (*_Eo_##Name##_func)(Eo *, void *obj_data); \ 1271 typedef void (*_Eo_##Name##_func)(Eo *, void *obj_data); \
1264 EFL_FUNC_COMMON_OP(obj, Name, ); \ 1272 EFL_FUNC_COMMON_OP(obj, Name, ); \
1265 _EFL_OBJECT_API_BEFORE_HOOK \ 1273 _EFL_OBJECT_API_BEFORE_HOOK \
1266 _EFL_OBJECT_API_CALL_HOOK(_func_(___call.eo_id, ___call.data)); \ 1274 _EFL_OBJECT_API_CALL_HOOK(_func_(_EO_CALL_OBJ(), ___call.data)); \
1267 _efl_object_call_end(&___call); \ 1275 _efl_object_call_end(&___call); \
1268 _EFL_OBJECT_API_AFTER_HOOK \ 1276 _EFL_OBJECT_API_AFTER_HOOK \
1269 return; \ 1277 return; \
@@ -1278,7 +1286,7 @@ __##Name##_failed: \
1278 Ret _r; \ 1286 Ret _r; \
1279 EFL_FUNC_COMMON_OP(obj, Name, DefRet); \ 1287 EFL_FUNC_COMMON_OP(obj, Name, DefRet); \
1280 _EFL_OBJECT_API_BEFORE_HOOK \ 1288 _EFL_OBJECT_API_BEFORE_HOOK \
1281 _r = _EFL_OBJECT_API_CALL_HOOK(_func_(___call.eo_id, ___call.data, Arguments)); \ 1289 _r = _EFL_OBJECT_API_CALL_HOOK(_func_(_EO_CALL_OBJ(), ___call.data, Arguments)); \
1282 _efl_object_call_end(&___call); \ 1290 _efl_object_call_end(&___call); \
1283 _EFL_OBJECT_API_AFTER_HOOK \ 1291 _EFL_OBJECT_API_AFTER_HOOK \
1284 return _r; \ 1292 return _r; \
@@ -1292,7 +1300,7 @@ __##Name##_failed: \
1292 typedef void (*_Eo_##Name##_func)(Eo *, void *obj_data, __VA_ARGS__); \ 1300 typedef void (*_Eo_##Name##_func)(Eo *, void *obj_data, __VA_ARGS__); \
1293 EFL_FUNC_COMMON_OP(obj, Name, ); \ 1301 EFL_FUNC_COMMON_OP(obj, Name, ); \
1294 _EFL_OBJECT_API_BEFORE_HOOK \ 1302 _EFL_OBJECT_API_BEFORE_HOOK \
1295 _EFL_OBJECT_API_CALL_HOOK(_func_(___call.eo_id, ___call.data, Arguments)); \ 1303 _EFL_OBJECT_API_CALL_HOOK(_func_(_EO_CALL_OBJ(), ___call.data, Arguments)); \
1296 _efl_object_call_end(&___call); \ 1304 _efl_object_call_end(&___call); \
1297 _EFL_OBJECT_API_AFTER_HOOK \ 1305 _EFL_OBJECT_API_AFTER_HOOK \
1298 return; \ 1306 return; \
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index d421c58bc8..ae13754fcf 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -2,6 +2,8 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <signal.h>
6
5#if defined HAVE_DLADDR && ! defined _WIN32 7#if defined HAVE_DLADDR && ! defined _WIN32
6# include <dlfcn.h> 8# include <dlfcn.h>
7#endif 9#endif
@@ -303,7 +305,11 @@ _vtable_func_clean_all(Eo_Vtable *vtable)
303 305
304/* END OF DICH */ 306/* END OF DICH */
305 307
306#define _EO_ID_GET(Id) ((Eo_Id) (Id)) 308#ifdef EO_NO_PTR_INDIRECTION
309# define _EO_ID_GET(Id) (((const Eo_Header *) (Id))->id)
310#else
311# define _EO_ID_GET(Id) ((Eo_Id) (Id))
312#endif
307 313
308 314
309static inline Eina_Bool 315static inline Eina_Bool
@@ -323,7 +329,11 @@ _eo_is_a_class(const Eo *eo_id)
323static inline _Efl_Class * 329static inline _Efl_Class *
324_eo_class_pointer_get(const Efl_Class *klass_id) 330_eo_class_pointer_get(const Efl_Class *klass_id)
325{ 331{
332#ifdef EO_NO_PTR_INDIRECTION
333 return (_Efl_Class *)klass_id;
334#else
326 return ID_CLASS_GET((Eo_Id)klass_id); 335 return ID_CLASS_GET((Eo_Id)klass_id);
336#endif
327} 337}
328 338
329static const char * 339static const char *
@@ -452,7 +462,11 @@ _efl_object_call_resolve(Eo *eo_id, const char *func_name, Efl_Object_Op_Call_Da
452 462
453 if (EINA_UNLIKELY(!eo_id)) return EINA_FALSE; 463 if (EINA_UNLIKELY(!eo_id)) return EINA_FALSE;
454 464
465#ifdef EO_NO_PTR_INDIRECTION
466 call->eo_id = _eo_obj_id_get((const _Eo_Object*)eo_id);
467#else
455 call->eo_id = eo_id; 468 call->eo_id = eo_id;
469#endif
456 470
457 is_obj = _eo_is_a_obj(eo_id); 471 is_obj = _eo_is_a_obj(eo_id);
458 472
@@ -622,7 +636,7 @@ err:
622 efl_unref(eo_id); 636 efl_unref(eo_id);
623 } 637 }
624 _efl_unref(obj); 638 _efl_unref(obj);
625 _eo_obj_pointer_done((Eo_Id)eo_id); 639 EO_OBJ_DONE(eo_id);
626 } 640 }
627 return EINA_FALSE; 641 return EINA_FALSE;
628 642
@@ -678,10 +692,10 @@ _efl_object_call_end(Efl_Object_Op_Call_Data *call)
678 if (EINA_UNLIKELY(call->obj->auto_unref != 0)) 692 if (EINA_UNLIKELY(call->obj->auto_unref != 0))
679 { 693 {
680 if (call->obj->finalized && !(--call->obj->auto_unref)) 694 if (call->obj->finalized && !(--call->obj->auto_unref))
681 efl_unref(call->eo_id); 695 efl_unref((Eo*)(call->obj));
682 } 696 }
683 _efl_unref(call->obj); 697 _efl_unref(call->obj);
684 _eo_obj_pointer_done((Eo_Id)call->eo_id); 698 EO_OBJ_DONE(call->obj);
685 } 699 }
686} 700}
687 701
@@ -892,7 +906,9 @@ err_klass:
892EAPI Eo * 906EAPI Eo *
893_efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent_id, Eina_Bool ref EINA_UNUSED, Eina_Bool is_fallback) 907_efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent_id, Eina_Bool ref EINA_UNUSED, Eina_Bool is_fallback)
894{ 908{
909#ifndef EO_NO_PTR_INDIRECTION
895 const char *func_name = __FUNCTION__; 910 const char *func_name = __FUNCTION__;
911#endif
896 _Eo_Object *obj; 912 _Eo_Object *obj;
897 Eo_Stack_Frame *fptr = NULL; 913 Eo_Stack_Frame *fptr = NULL;
898 914
@@ -927,7 +943,11 @@ _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, E
927 obj->klass = klass; 943 obj->klass = klass;
928 944
929 obj->header.id = _eo_id_allocate(obj, parent_id); 945 obj->header.id = _eo_id_allocate(obj, parent_id);
946#ifdef EO_NO_PTR_INDIRECTION
947 Eo *eo_id = (Eo *)obj;
948#else
930 Eo *eo_id = _eo_obj_id_get(obj); 949 Eo *eo_id = _eo_obj_id_get(obj);
950#endif
931 951
932 _eo_log_obj_ref_op(obj, EO_REF_OP_NEW); 952 _eo_log_obj_ref_op(obj, EO_REF_OP_NEW);
933 953
@@ -943,7 +963,11 @@ _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, E
943 // not likely so use goto to alleviate l1 instruction cache of rare code 963 // not likely so use goto to alleviate l1 instruction cache of rare code
944 if (!eo_id) goto err_noid; 964 if (!eo_id) goto err_noid;
945 // not likely so use goto to alleviate l1 instruction cache of rare code 965 // not likely so use goto to alleviate l1 instruction cache of rare code
966#ifdef EO_NO_PTR_INDIRECTION
967 else if (eo_id != (Eo*)obj) goto ok_nomatch;
968#else
946 else if (eo_id != _eo_obj_id_get(obj)) goto ok_nomatch; 969 else if (eo_id != _eo_obj_id_get(obj)) goto ok_nomatch;
970#endif
947ok_nomatch_back: 971ok_nomatch_back:
948 if (is_fallback) fptr->obj = eo_id; 972 if (is_fallback) fptr->obj = eo_id;
949 if (parent_id) EO_OBJ_DONE(parent_id); 973 if (parent_id) EO_OBJ_DONE(parent_id);
@@ -954,7 +978,11 @@ ok_nomatch:
954 EO_OBJ_POINTER_GOTO_PROXY(eo_id, new_obj, err_newid); 978 EO_OBJ_POINTER_GOTO_PROXY(eo_id, new_obj, err_newid);
955 /* We have two refs at this point. */ 979 /* We have two refs at this point. */
956 _efl_unref(obj); 980 _efl_unref(obj);
981#ifdef EO_NO_PTR_INDIRECTION
982 efl_del((Eo*)obj);
983#else
957 efl_del((Eo *)obj->header.id); 984 efl_del((Eo *)obj->header.id);
985#endif
958 _efl_ref(new_obj); 986 _efl_ref(new_obj);
959 EO_OBJ_DONE(eo_id); 987 EO_OBJ_DONE(eo_id);
960 } 988 }
@@ -965,7 +993,11 @@ err_noid:
965 file, line, klass->desc->name); 993 file, line, klass->desc->name);
966 /* We have two refs at this point. */ 994 /* We have two refs at this point. */
967 _efl_unref(obj); 995 _efl_unref(obj);
996#ifdef EO_NO_PTR_INDIRECTION
997 efl_del((Eo*)obj);
998#else
968 efl_del((Eo *) obj->header.id); 999 efl_del((Eo *) obj->header.id);
1000#endif
969err_newid: 1001err_newid:
970 if (parent_id) EO_OBJ_DONE(parent_id); 1002 if (parent_id) EO_OBJ_DONE(parent_id);
971 return NULL; 1003 return NULL;
@@ -1016,7 +1048,11 @@ err_condtor:
1016 } 1048 }
1017cleanup: 1049cleanup:
1018 _efl_unref(obj); 1050 _efl_unref(obj);
1051#ifdef EO_NO_PTR_INDIRECTION
1052 efl_del((Eo*)obj);
1053#else
1019 efl_del((Eo *) obj->header.id); 1054 efl_del((Eo *) obj->header.id);
1055#endif
1020 EO_OBJ_DONE(eo_id); 1056 EO_OBJ_DONE(eo_id);
1021 return NULL; 1057 return NULL;
1022} 1058}
@@ -1142,7 +1178,11 @@ efl_class_get(const Eo *eo_id)
1142 } 1178 }
1143 1179
1144 EO_OBJ_POINTER_GOTO(eo_id, obj, err_obj); 1180 EO_OBJ_POINTER_GOTO(eo_id, obj, err_obj);
1181#ifdef EO_NO_PTR_INDIRECTION
1182 klass = (const Efl_Class *)obj->klass;
1183#else
1145 klass = _eo_class_id_get(obj->klass); 1184 klass = _eo_class_id_get(obj->klass);
1185#endif
1146 EO_OBJ_DONE(eo_id); 1186 EO_OBJ_DONE(eo_id);
1147 return klass; 1187 return klass;
1148 1188
@@ -1314,7 +1354,11 @@ static Eina_Bool
1314_eo_class_initializer(_Efl_Class *klass) 1354_eo_class_initializer(_Efl_Class *klass)
1315{ 1355{
1316 if (klass->desc->class_initializer) 1356 if (klass->desc->class_initializer)
1357#ifdef EO_NO_PTR_INDIRECTION
1358 return klass->desc->class_initializer((Efl_Class *)klass);
1359#else
1317 return klass->desc->class_initializer(_eo_class_id_get(klass)); 1360 return klass->desc->class_initializer(_eo_class_id_get(klass));
1361#endif
1318 1362
1319 return EINA_TRUE; 1363 return EINA_TRUE;
1320} 1364}
@@ -1325,7 +1369,11 @@ _eo_class_constructor(_Efl_Class *klass)
1325 klass->constructed = EINA_TRUE; 1369 klass->constructed = EINA_TRUE;
1326 1370
1327 if (klass->desc->class_constructor) 1371 if (klass->desc->class_constructor)
1372#ifdef EO_NO_PTR_INDIRECTION
1373 klass->desc->class_constructor((Efl_Class *)klass);
1374#else
1328 klass->desc->class_constructor(_eo_class_id_get(klass)); 1375 klass->desc->class_constructor(_eo_class_id_get(klass));
1376#endif
1329} 1377}
1330 1378
1331static void 1379static void
@@ -1655,7 +1703,11 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
1655 /* If functions haven't been set, invoke it with an empty ops structure. */ 1703 /* If functions haven't been set, invoke it with an empty ops structure. */
1656 if (!klass->functions_set) 1704 if (!klass->functions_set)
1657 { 1705 {
1706#ifdef EO_NO_PTR_INDIRECTION
1707 efl_class_functions_set((const Efl_Class*)klass, NULL, NULL);
1708#else
1658 efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL); 1709 efl_class_functions_set(_eo_class_id_get(klass), NULL, NULL);
1710#endif
1659 } 1711 }
1660 1712
1661 /* Mark which classes we implement */ 1713 /* Mark which classes we implement */
@@ -1668,7 +1720,11 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
1668 1720
1669 DBG("Finished building class '%s'", klass->desc->name); 1721 DBG("Finished building class '%s'", klass->desc->name);
1670 1722
1723#ifdef EO_NO_PTR_INDIRECTION
1724 return (const Efl_Class*) klass;
1725#else
1671 return _eo_class_id_get(klass); 1726 return _eo_class_id_get(klass);
1727#endif
1672} 1728}
1673 1729
1674EAPI Eina_Bool 1730EAPI Eina_Bool
@@ -1721,6 +1777,21 @@ err:
1721EAPI Eina_Bool 1777EAPI Eina_Bool
1722efl_isa(const Eo *eo_id, const Efl_Class *klass_id) 1778efl_isa(const Eo *eo_id, const Efl_Class *klass_id)
1723{ 1779{
1780#ifdef EO_NO_PTR_INDIRECTION
1781 if (EINA_UNLIKELY(!eo_id)) return EINA_FALSE;
1782
1783 EO_OBJ_POINTER_GOTO(eo_id, obj, fail);
1784 EO_CLASS_POINTER_GOTO(klass_id, klass, fail);
1785
1786 const op_type_funcs *func = _vtable_func_get
1787 (EO_VTABLE(obj), klass->base_id + klass->ops_count);
1788
1789 return (func && (func->func == _eo_class_isa_func));
1790fail:
1791 raise(SIGABRT);
1792 return EINA_FALSE;
1793
1794#else
1724 Efl_Id_Domain domain; 1795 Efl_Id_Domain domain;
1725 Eo_Id_Data *data; 1796 Eo_Id_Data *data;
1726 Eo_Id_Table_Data *tdata; 1797 Eo_Id_Table_Data *tdata;
@@ -1806,6 +1877,7 @@ err:
1806 (data->tables[0]) ? "0" : " ", (data->tables[1]) ? "1" : " ", 1877 (data->tables[0]) ? "0" : " ", (data->tables[1]) ? "1" : " ",
1807 (data->tables[2]) ? "2" : " ", (data->tables[3]) ? "3" : " "); 1878 (data->tables[2]) ? "2" : " ", (data->tables[3]) ? "3" : " ");
1808 return EINA_FALSE; 1879 return EINA_FALSE;
1880#endif
1809} 1881}
1810 1882
1811EAPI Eo * 1883EAPI Eo *
@@ -1814,7 +1886,9 @@ efl_xref_internal(const char *file, int line, Eo *obj_id, const Eo *ref_obj_id)
1814 efl_ref(obj_id); 1886 efl_ref(obj_id);
1815 1887
1816#ifdef EO_DEBUG 1888#ifdef EO_DEBUG
1889# ifndef EO_NO_PTR_INDIRECTION
1817 const char *func_name = __FUNCTION__; 1890 const char *func_name = __FUNCTION__;
1891# endif
1818 EO_OBJ_POINTER_RETURN_VAL_PROXY(obj_id, obj, obj_id); 1892 EO_OBJ_POINTER_RETURN_VAL_PROXY(obj_id, obj, obj_id);
1819 1893
1820 Eo_Xref_Node *xref = calloc(1, sizeof(*xref)); 1894 Eo_Xref_Node *xref = calloc(1, sizeof(*xref));
@@ -2128,7 +2202,9 @@ efl_data_xref_internal(const char *file, int line, const Eo *obj_id, const Efl_C
2128{ 2202{
2129 void *ret = NULL; 2203 void *ret = NULL;
2130 _Efl_Class *klass = NULL; 2204 _Efl_Class *klass = NULL;
2205#ifndef EO_NO_PTR_INDIRECTION
2131 const char *func_name = __FUNCTION__; 2206 const char *func_name = __FUNCTION__;
2207#endif
2132 EO_OBJ_POINTER_RETURN_VAL_PROXY(obj_id, obj, NULL); 2208 EO_OBJ_POINTER_RETURN_VAL_PROXY(obj_id, obj, NULL);
2133 EO_OBJ_POINTER_PROXY(ref_obj_id, ref_obj); 2209 EO_OBJ_POINTER_PROXY(ref_obj_id, ref_obj);
2134 if (ref_obj) 2210 if (ref_obj)
@@ -2491,12 +2567,19 @@ efl_domain_data_return(Efl_Id_Domain domain)
2491EAPI Eina_Bool 2567EAPI Eina_Bool
2492efl_compatible(const Eo *obj, const Eo *obj_target) 2568efl_compatible(const Eo *obj, const Eo *obj_target)
2493{ 2569{
2570#ifdef EO_NO_PTR_INDIRECTION
2571 CRI("UNSUPPORTED");
2572 (void) obj;
2573 (void) obj_target;
2574 return EINA_FALSE;
2575#else
2494 Efl_Id_Domain domain1 = ((Eo_Id)obj >> SHIFT_DOMAIN) & MASK_DOMAIN; 2576 Efl_Id_Domain domain1 = ((Eo_Id)obj >> SHIFT_DOMAIN) & MASK_DOMAIN;
2495 Efl_Id_Domain domain2 = ((Eo_Id)obj_target >> SHIFT_DOMAIN) & MASK_DOMAIN; 2577 Efl_Id_Domain domain2 = ((Eo_Id)obj_target >> SHIFT_DOMAIN) & MASK_DOMAIN;
2496 if (domain1 == domain2) return EINA_TRUE; 2578 if (domain1 == domain2) return EINA_TRUE;
2497 DBG("Object %p and %p are not compatible. Domain %i and %i do not match", 2579 DBG("Object %p and %p are not compatible. Domain %i and %i do not match",
2498 obj, obj_target, domain1, domain2); 2580 obj, obj_target, domain1, domain2);
2499 return EINA_FALSE; 2581 return EINA_FALSE;
2582#endif
2500} 2583}
2501 2584
2502EAPI Eina_Bool 2585EAPI Eina_Bool
@@ -2589,10 +2672,15 @@ efl_debug_name_get(const Eo *obj_id)
2589 } 2672 }
2590 else 2673 else
2591 { 2674 {
2675#ifdef EO_NO_PTR_INDIRECTION
2676 Efl_Class *klass_obj = (Efl_Class*)obj->cur_klass;
2677#else
2678 Efl_Class *klass_obj = (Efl_Class *) obj->cur_klass->header.id;
2679#endif
2592 if (obj->super) 2680 if (obj->super)
2593 efl_debug_name_override(efl_super(obj_id, (Efl_Class *) obj->cur_klass->header.id), sb); 2681 efl_debug_name_override(efl_super(obj_id, klass_obj), sb);
2594 else 2682 else
2595 efl_debug_name_override(efl_cast(obj_id, (Efl_Class *) obj->cur_klass->header.id), sb); 2683 efl_debug_name_override(efl_cast(obj_id, klass_obj), sb);
2596 obj->super = EINA_FALSE; 2684 obj->super = EINA_FALSE;
2597 obj->cur_klass = NULL; 2685 obj->cur_klass = NULL;
2598 } 2686 }
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index aba4fb392e..32f5c1535e 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -513,7 +513,11 @@ _efl_object_name_find(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const char
513 name_glob = _hasglob(search_name); 513 name_glob = _hasglob(search_name);
514 EINA_INLIST_FOREACH(pd->children, child_eo) 514 EINA_INLIST_FOREACH(pd->children, child_eo)
515 { 515 {
516#ifdef EO_NO_PTR_INDIRECTION
517 child = (Eo*)child_eo;
518#else
516 child = _eo_obj_id_get(child_eo); 519 child = _eo_obj_id_get(child_eo);
520#endif
517 name = efl_name_get(child); 521 name = efl_name_get(child);
518 klass_name = efl_class_name_get(efl_class_get(child)); 522 klass_name = efl_class_name_get(efl_class_get(child));
519 if (_name_match(klass, klass_glob, klass_name) && 523 if (_name_match(klass, klass_glob, klass_name) &&
@@ -531,7 +535,11 @@ _efl_object_name_find(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const char
531 // we have a glob - fnmatch 535 // we have a glob - fnmatch
532 EINA_INLIST_FOREACH(pd->children, child_eo) 536 EINA_INLIST_FOREACH(pd->children, child_eo)
533 { 537 {
538#ifdef EO_NO_PTR_INDIRECTION
539 child = (Eo*)child_eo;
540#else
534 child = _eo_obj_id_get(child_eo); 541 child = _eo_obj_id_get(child_eo);
542#endif
535 name = efl_name_get(child); 543 name = efl_name_get(child);
536 if ((name) && (_name_match(search, EINA_TRUE, name))) 544 if ((name) && (_name_match(search, EINA_TRUE, name)))
537 return child; 545 return child;
@@ -544,7 +552,11 @@ _efl_object_name_find(const Eo *obj EINA_UNUSED, Efl_Object_Data *pd, const char
544 // fast path for simple "name" 552 // fast path for simple "name"
545 EINA_INLIST_FOREACH(pd->children, child_eo) 553 EINA_INLIST_FOREACH(pd->children, child_eo)
546 { 554 {
555#ifdef EO_NO_PTR_INDIRECTION
556 child = (Eo*)child_eo;
557#else
547 child = _eo_obj_id_get(child_eo); 558 child = _eo_obj_id_get(child_eo);
559#endif
548 name = efl_name_get(child); 560 name = efl_name_get(child);
549 if ((name) && (_name_match(search, EINA_FALSE, name))) 561 if ((name) && (_name_match(search, EINA_FALSE, name)))
550 return child; 562 return child;
@@ -717,7 +729,11 @@ _efl_children_iterator_next(Eo_Children_Iterator *it, void **data)
717 if (data) 729 if (data)
718 { 730 {
719 _Eo_Object *eo_obj = EINA_INLIST_CONTAINER_GET(it->current, _Eo_Object); 731 _Eo_Object *eo_obj = EINA_INLIST_CONTAINER_GET(it->current, _Eo_Object);
732#ifdef EO_NO_PTR_INDIRECTION
733 *data = eo_obj;
734#else
720 *data = _eo_obj_id_get(eo_obj); 735 *data = _eo_obj_id_get(eo_obj);
736#endif
721 } 737 }
722 it->current = it->current->next; 738 it->current = it->current->next;
723 739
@@ -2070,8 +2086,13 @@ err_parent_back:
2070children: 2086children:
2071 while (pd->children) 2087 while (pd->children)
2072 { 2088 {
2089#ifdef EO_NO_PTR_INDIRECTION
2090 child = (Eo*)EINA_INLIST_CONTAINER_GET(pd->children, _Eo_Object);
2091#else
2073 child = _eo_obj_id_get(EINA_INLIST_CONTAINER_GET(pd->children, _Eo_Object)); 2092 child = _eo_obj_id_get(EINA_INLIST_CONTAINER_GET(pd->children, _Eo_Object));
2093#endif
2074 efl_parent_set(child, NULL); 2094 efl_parent_set(child, NULL);
2095
2075 } 2096 }
2076 goto children_back; 2097 goto children_back;
2077 2098
diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h
index 38f8c9eb03..6879cdae58 100644
--- a/src/lib/eo/eo_private.h
+++ b/src/lib/eo/eo_private.h
@@ -226,7 +226,11 @@ Eo *_eo_header_id_get(const Eo_Header *header)
226} 226}
227 227
228/* Retrieves the pointer to the object from the id */ 228/* Retrieves the pointer to the object from the id */
229#ifdef EO_NO_PTR_INDIRECTION
230#define _eo_obj_pointer_get(ObjId, Func, File, Line) ((_Eo_Object *)(ObjId))
231#else
229_Eo_Object *_eo_obj_pointer_get(const Eo_Id obj_id, const char *func_name, const char *file, int line); 232_Eo_Object *_eo_obj_pointer_get(const Eo_Id obj_id, const char *func_name, const char *file, int line);
233#endif
230 234
231static inline 235static inline
232Efl_Class *_eo_class_id_get(const _Efl_Class *klass) 236Efl_Class *_eo_class_id_get(const _Efl_Class *klass)
@@ -254,11 +258,19 @@ _efl_del_internal(_Eo_Object *obj, const char *func_name, const char *file, int
254 258
255 const _Efl_Class *klass = obj->klass; 259 const _Efl_Class *klass = obj->klass;
256 260
261#ifdef EO_NO_PTR_INDIRECTION
262 efl_event_callback_call((Eo*)obj, EFL_EVENT_DEL, NULL);
263#else
257 efl_event_callback_call(_eo_obj_id_get(obj), EFL_EVENT_DEL, NULL); 264 efl_event_callback_call(_eo_obj_id_get(obj), EFL_EVENT_DEL, NULL);
265#endif
258 266
259 _eo_condtor_reset(obj); 267 _eo_condtor_reset(obj);
260 268
269#ifdef EO_NO_PTR_INDIRECTION
270 efl_destructor((Eo*)obj);
271#else
261 efl_destructor(_eo_obj_id_get(obj)); 272 efl_destructor(_eo_obj_id_get(obj));
273#endif
262 274
263 if (!obj->condtor_done) 275 if (!obj->condtor_done)
264 { 276 {
@@ -272,7 +284,11 @@ _efl_del_internal(_Eo_Object *obj, const char *func_name, const char *file, int
272 Eo *emb_obj; 284 Eo *emb_obj;
273 EINA_LIST_FOREACH_SAFE(obj->opt->composite_objects, itr, itr_n, emb_obj) 285 EINA_LIST_FOREACH_SAFE(obj->opt->composite_objects, itr, itr_n, emb_obj)
274 { 286 {
287#ifdef EO_NO_PTR_INDIRECTION
288 efl_composite_detach((Eo*)obj, emb_obj);
289#else
275 efl_composite_detach(_eo_obj_id_get(obj), emb_obj); 290 efl_composite_detach(_eo_obj_id_get(obj), emb_obj);
291#endif
276 } 292 }
277 } 293 }
278 294
@@ -325,7 +341,11 @@ _efl_unref_internal(_Eo_Object *obj, const char *func_name, const char *file, in
325 341
326 if (obj->opt->del_intercept) 342 if (obj->opt->del_intercept)
327 { 343 {
344#ifdef EO_NO_PTR_INDIRECTION
345 Eo *obj_id = (Eo*)obj;
346#else
328 Eo *obj_id = _eo_obj_id_get(obj); 347 Eo *obj_id = _eo_obj_id_get(obj);
348#endif
329 efl_ref(obj_id); 349 efl_ref(obj_id);
330 obj->opt->del_intercept(obj_id); 350 obj->opt->del_intercept(obj_id);
331 return; 351 return;
diff --git a/src/lib/eo/eo_ptr_indirection.c b/src/lib/eo/eo_ptr_indirection.c
index 01db8a289a..a2ff186339 100644
--- a/src/lib/eo/eo_ptr_indirection.c
+++ b/src/lib/eo/eo_ptr_indirection.c
@@ -25,6 +25,7 @@ _eo_pointer_error(const Eo *obj_id, const char *func_name, const char *file, int
25 _eo_log_obj_report((Eo_Id)obj_id, EINA_LOG_LEVEL_ERR, func_name, file, line); 25 _eo_log_obj_report((Eo_Id)obj_id, EINA_LOG_LEVEL_ERR, func_name, file, line);
26} 26}
27 27
28#ifndef EO_NO_PTR_INDIRECTION
28static void 29static void
29_eo_obj_pointer_invalid(const Eo_Id obj_id, 30_eo_obj_pointer_invalid(const Eo_Id obj_id,
30 Eo_Id_Data *data, 31 Eo_Id_Data *data,
@@ -189,3 +190,4 @@ err:
189 _eo_obj_pointer_invalid(obj_id, data, domain, func_name, file, line); 190 _eo_obj_pointer_invalid(obj_id, data, domain, func_name, file, line);
190 return NULL; 191 return NULL;
191} 192}
193#endif
diff --git a/src/lib/eo/eo_ptr_indirection.h b/src/lib/eo/eo_ptr_indirection.h
index 9cde5ba0c2..f83808f853 100644
--- a/src/lib/eo/eo_ptr_indirection.h
+++ b/src/lib/eo/eo_ptr_indirection.h
@@ -56,7 +56,7 @@ void _eo_pointer_error(const Eo *obj_id, const char *func_name, const char *file
56 _Eo_Object *obj; \ 56 _Eo_Object *obj; \
57 do { \ 57 do { \
58 obj = _eo_obj_pointer_get((Eo_Id)obj_id, __FUNCTION__, __FILE__, __LINE__); \ 58 obj = _eo_obj_pointer_get((Eo_Id)obj_id, __FUNCTION__, __FILE__, __LINE__); \
59 if (!obj) goto label; \ 59 if (EINA_UNLIKELY(!obj)) goto label; \
60 } while (0) 60 } while (0)
61 61
62#define EO_OBJ_POINTER_GOTO_PROXY(obj_id, obj, label) \ 62#define EO_OBJ_POINTER_GOTO_PROXY(obj_id, obj, label) \
@@ -132,8 +132,13 @@ void _eo_pointer_error(const Eo *obj_id, const char *func_name, const char *file
132 if (!klass) goto label; \ 132 if (!klass) goto label; \
133 } while (0) 133 } while (0)
134 134
135#define EO_OBJ_DONE(obj_id) \ 135#ifdef EO_NO_PTR_INDIRECTION
136# define EO_OBJ_DONE(obj_id) \
137 _eo_obj_pointer_done((Eo_Id)_eo_obj_id_get((const _Eo_Object*)obj_id))
138#else
139# define EO_OBJ_DONE(obj_id) \
136 _eo_obj_pointer_done((Eo_Id)obj_id) 140 _eo_obj_pointer_done((Eo_Id)obj_id)
141#endif
137 142
138#ifdef EFL_DEBUG 143#ifdef EFL_DEBUG
139static inline void _eo_print(Eo_Id_Table_Data *tdata); 144static inline void _eo_print(Eo_Id_Table_Data *tdata);
diff --git a/src/lib/eo/eo_ptr_indirection.x b/src/lib/eo/eo_ptr_indirection.x
index f4311e1c3a..49fc9c0b0e 100644
--- a/src/lib/eo/eo_ptr_indirection.x
+++ b/src/lib/eo/eo_ptr_indirection.x
@@ -368,6 +368,10 @@ _eo_table_data_table_get(Eo_Id_Data *data, Efl_Id_Domain domain)
368static inline Eina_Bool 368static inline Eina_Bool
369_eo_id_domain_compatible(const Eo *o1, const Eo *o2) 369_eo_id_domain_compatible(const Eo *o1, const Eo *o2)
370{ 370{
371#ifdef EO_NO_PTR_INDIRECTION
372 o1 = _eo_obj_id_get((const _Eo_Object*)o1);
373 o2 = _eo_obj_id_get((const _Eo_Object*)o2);
374#endif
371 Efl_Id_Domain domain1 = ((Eo_Id)o1 >> SHIFT_DOMAIN) & MASK_DOMAIN; 375 Efl_Id_Domain domain1 = ((Eo_Id)o1 >> SHIFT_DOMAIN) & MASK_DOMAIN;
372 Efl_Id_Domain domain2 = ((Eo_Id)o2 >> SHIFT_DOMAIN) & MASK_DOMAIN; 376 Efl_Id_Domain domain2 = ((Eo_Id)o2 >> SHIFT_DOMAIN) & MASK_DOMAIN;
373 if (domain1 == domain2) return EINA_TRUE; 377 if (domain1 == domain2) return EINA_TRUE;
@@ -509,6 +513,9 @@ _eo_id_allocate(const _Eo_Object *obj, const Eo *parent_id)
509 data = _eo_table_data_get(); 513 data = _eo_table_data_get();
510 if (parent_id) 514 if (parent_id)
511 { 515 {
516#ifdef EO_NO_PTR_INDIRECTION
517 parent_id = (const Eo *)(((const Eo_Header *)parent_id)->id);
518#endif
512 Efl_Id_Domain domain = ((Eo_Id)parent_id >> SHIFT_DOMAIN) & MASK_DOMAIN; 519 Efl_Id_Domain domain = ((Eo_Id)parent_id >> SHIFT_DOMAIN) & MASK_DOMAIN;
513 tdata = _eo_table_data_table_get(data, domain); 520 tdata = _eo_table_data_table_get(data, domain);
514 } 521 }