Commit Graph

130 Commits

Author SHA1 Message Date
Jérémy Zurcher c9ccc700fd eo2: add eo2_parent_set(), eo2_parent_get(), eo2_children_iterator_new()
imported from eo_base_class.c as is in
a7f417e 2013-12-24 23:45:30 +0900 <Carsten Haitzler (Rasterman)>
2014-04-10 04:20:17 +01:00
Jérémy Zurcher 796b151c27 eo2: minor fixes after huge rebase
indentation
use _Eo_Object * instead of _Eo *
use EO_CLASS_POINTER_RETURN_VAL(), _eo_id_get(), and _eo_class_id_get().
2014-04-10 04:20:17 +01:00
Jérémy Zurcher 3a86881941 eo2: eo2_do_start use EO_OBJ_POINTER_ macros not _eo_obj_pointer_get 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 74f7bf3633 eo2: eo2_call_resolve_internal support undef HAVE_EO_ID 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 2af0764eeb eo2: _eo2_api_desc_get: walks in mro not in klass->parent 2014-04-10 04:20:17 +01:00
Jérémy Zurcher fe23e26d0e eo2: add DBG msg in eo2_class_funcs_set 2014-04-10 04:20:17 +01:00
Cedric Bail 8613ebe403 eo2: memset will be faster, still why not using NULL instead of -1 ? 2014-04-10 04:20:17 +01:00
Cedric Bail 0b279b600e eo2: we can rely on LD_PRELOAD for those hook, so removing them. 2014-04-10 04:20:17 +01:00
Cedric Bail 4b97591634 eo2: add hook for beinning and start of all function execution and for all _do.
NOTE: I don't know what the _CLASS_FUNC are, so I may have broken stuff there.
2014-04-10 04:20:17 +01:00
Jérémy Zurcher bbab74320a eo2: fix eo2 custom constructors 2014-04-10 04:20:17 +01:00
Jérémy Zurcher ebc90200a6 eo2: sprinkle with 'const' 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 8959832be4 eo2: fixed EO2_CLASS_FUNC_BODY and etc. functions. 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 4f73887b47 eo2: remove EO2_OP_FUNC_VIRTUAL
a pure virtual function is an EO2_OP_FUNC
with NULL as private function implementation pointer
2014-04-10 04:20:17 +01:00
Tom Hacohen 5f45e57b89 eo2: revert "eo2_add accepts non-defauld constructors"
We want to have normal functions as non-default constructors, not va_arg
ones. What we should do is split the object creation to two parts again.
The creation, the constructing (changes using the macro) and the
verification/end part that checks the constructor has been called.

This reverts commit 2ff2ce1894f173b306a896bda595e1a7768c074d.
2014-04-10 04:20:17 +01:00
Jérémy Zurcher 7be0748b34 eo2: implement class function support 2014-04-10 04:20:17 +01:00
Jérémy Zurcher e82c0f6bf7 eo2: fix indent 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 42ad23c5c8 eo2: eo2_add accepts non-defauld constructors 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 2d5baec80c eo2: call _eo2_class_funcs_set from _eo_class_constructor 2014-04-10 04:20:16 +01:00
Jérémy Zurcher b6991985ed eo2: eo2_do() uses __attribute__ cleanup
to protect us against bad use of break, goto, return ... in eo2_do,
we use __attribute__((cleanup(eo2_do_end))) to ensure that eo2_do_end()
is called whatever.
2014-04-10 04:20:16 +01:00
Jérémy Zurcher adc1ac0c23 eo2: add eo2_call_stack_depth 2014-04-10 04:20:16 +01:00
Jérémy Zurcher eeff3e898c eo2: EO2_CALL_STACK_SIZE -> EO2_CALL_STACK_DEPTH 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 1aa3b1536f eo2: add virtual func support 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 13b1d03def eo2: _eo2_api_desc_get() searches the class hierarchy 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 5febcc9ff1 eo2: oops, forgot to init desc to NULL in eo2_api_op_id_get() 2014-04-10 04:20:16 +01:00
Jérémy Zurcher d61a31a645 eo2: can't detect return in a eo2_do macro, *sigh* 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 9c4731f606 eo2: eo2_api_op_id_get search in parent klasses too 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 1d9d0cee9c eo2: EO2_OP_FUNC_OVERRIDE copy doc from overriden func 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 2edd305507 eo2: set eo2_constructor and eo2_destructor chaining 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 7621758c80 eo2: use EO2_VERSION 2014-04-10 04:20:16 +01:00
Jérémy Zurcher c17a30dfb9 eo2: add cur_klass in call Stack and eo2_do_super
in eo2_do_start(), reuse previous stack fetched pointers when possible
2014-04-10 04:20:16 +01:00
Jérémy Zurcher 68fb3d4c03 eo2: improve func overriding
add klass_id parameter to eo2_get_op_id()
in op descriptions, allow NULL fct pointer for virtual,
and use EO2_OP_OVERRIDE to declare overriding.
2014-04-10 04:20:16 +01:00
Jérémy Zurcher 6a16edc888 eo2: call stack Proof Of Concept
no grow/shrink or thread local storage
2014-04-10 04:20:16 +01:00
Jérémy Zurcher 2490a1bef2 eo2: better op_descs integration
struct _Eo_Class_Description swallows
Eo2_Op_Description *descs2;
2014-04-10 04:20:15 +01:00
Jérémy Zurcher f05f51dd60 eo2: _Eo_Class_Description swallows op_descs
remove OpDescs argument from macros,
eo2_get_op_id() uses binary search
2014-04-10 04:20:15 +01:00
Jérémy Zurcher bc6019c154 eo2: add comments end clean up 2014-04-10 04:20:15 +01:00
Jérémy Zurcher 23ae1fc453 eo2: use internal unref, break if eo2_start returns NULL 2014-04-10 04:20:15 +01:00
Jérémy Zurcher 473609e1d3 eo2: eliminate the need of OPID and Eo_Op_Func_Description
at class elaboration, sort the op descriptions using the function pointer.
when calling a function, do a dichotomic search in the
class op descriptions to find the corresponding OP_ID,
then keep it in a static variable.
2014-04-10 04:20:15 +01:00
Jérémy Zurcher ef873b7b29 eo2: fix obj_data retrieval and speed up
obj_data which is built from func->src not obj->klass.
replace eo2_func_get() and eo2_data_scope_get() calls
with one call to eo2_call_resolve().
2014-04-10 04:20:15 +01:00
Jérémy Zurcher 71341334a9 eo2: add eo2_data_scope_get()
use it in function body
2014-04-10 04:20:15 +01:00
Tom Hacohen 35856fdd13 eo2: Eo2 first commit. 2014-04-10 04:20:15 +01:00
Tom Hacohen 8955c514c7 Eo: all classes are allowed in extension list.
All classes are allowed, because all classes can be used as interfaces in
order to override behaviour. This is especially needed for mixins and broke
the eo2 tests.
2014-04-01 14:22:00 +01:00
Stefan Schmidt 3716e9b12c eo: Make sure we have a va_end matching the va_start before returning.
Was fien on the normal path but missing on the error path. Also remove
the spurious break after the return. Would never be reached. Looks like
a copy and paste bug to me.

CID 1187638
2014-03-19 16:46:36 +01:00
Tom Hacohen e280f32c01 Eo: removed redundant macro. 2014-03-11 15:58:43 +00:00
Tom Hacohen 122a2f890e Eo: Made eo id for classes a bit more secure.
This patch sets the one before most significant bit on for classes. This
means that class ids are now very big, compared to the old ids which
were growing small integers (1, 2, 3...).
This makes accidental passing of integers (corrupted obj pointers) less
common.

@feature
2014-03-11 15:56:30 +00:00
Jérémy Zurcher ef09ef7489 eo: replace composite_objects Eina_List with an array of Eo_Object*
as we don't support multiple composites of the same class,
and know at class elaboration how many composites we should have,
we can create the composites array and pack it at the end of the object.
2014-03-05 23:57:39 +01:00
Jérémy Zurcher b763db3666 eo: memory waste at mixin class elaboration
@fix

mixins data offsets are stored in Eo_Extension_Data_Offset[],
if the constructed class is a mixin, do not reserve space for its
private data, the class is in mixins list and will be handled at
Eo_Extension_Data_Offset computation.

see  _eo_data_scope_get(...) for private data retrieval
2014-03-05 22:44:21 +01:00
Jérémy Zurcher c7922f92bc eo: revert 13502a1 and 7821df1
I'm running out of time, will look at it later
2014-02-27 15:02:45 +01:00
Jérémy Zurcher 2d52015823 eo: first check class desc in eo_class_new 2014-02-26 16:25:01 +01:00
Jérémy Zurcher 7821df17dc eo: replace composite_objects Eina_List with an array of Eo_Object*
as we don't support multiple composites of the same class,
and know at class elaboration how many composites we should have,
we can create the composites array and pack it at the end of the object.
2014-02-26 16:25:00 +01:00
Jérémy Zurcher 5be3b666b2 eo: block regular non-instantiable classes in class extension list 2014-02-26 16:25:00 +01:00