Commit Graph

388 Commits

Author SHA1 Message Date
Srivardhan Hebbar d180f4991b eo: updated documentation of eo_add and eo_ref_add.
Summary: Had a chat with raster to understand the behavior of these two functions in the IRC. Thought it might be helpful if added in the documentation itself. So updated it accordingly.

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2083

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-06 20:19:21 +01:00
Tom Hacohen 43629a95f3 Eo: Add eo_do_super_ret.
This is the equivalent of eo_do_ret for super calls.
2015-02-24 14:23:15 +00:00
Tom Hacohen a791d97bfc Eo: Remove GCCism and make it more portable.
This affects eo_do() and eo_add() that used to use the ({}) GCCism.
Following a discussion with Peter de Ridder after my talk at FOSDEM,
we've decided to reopen the GCCism (works with other gcc compatible
compilers like clang and intelc) discussion, and after a bit of back and
forth it was decided to make things more portable, at the cost of ease
of use.

For example:
if (eo_do(obj, visible_get()))
is no longer allowed, the portable alternative
Eina_Bool tmp;
if (eo_do_ret(obj, tmp, visible_get()))
is to be used instead.

However:
eo_do(obj, a = a_get(), b = b_get(), bool_set(!bool_get))
are still allowed and OK.

eo_do(obj, if (a_get()) return;);
is no longer allowed, but:
eo_do(obj, if (a_get()) something());
is still allowed.

For clarity, this commit only incorporates the Eo changes, and not the
EFL changes to make the efl conform with this change.

Thanks again to Peter de Ridder for triggering this important discussion
which led to this change.
2015-02-23 17:16:02 +00:00
Tom Hacohen 40cb2cd3d4 Eo add: beef up error reporting.
In some cases object ceration would fail without an error,
this is bad and should not happen.

Thanks to cedric for reporting.
2015-01-23 16:51:18 +00:00
Nicolas Aguirre 2982b05288 Eo: use int for _eo_init_count intsead of Eina_Bool 2015-01-12 14:48:22 +01:00
Tom Hacohen c0f67292d5 Eo base class: Fix compliation.
@inout also used to affect the type generated.
Compile check even the simplest changes.
2015-01-12 13:43:59 +00:00
Tom Hacohen 650f2b3149 Eo base: Remove @inout usage.
First step towards deprecation of @inout.
2015-01-12 13:33:39 +00:00
Daniel Zaoui d95224b5a7 Eo: add function name to the eo_do pre and post hooks.
This is useful to determine the Eolian class/function.
2015-01-11 16:28:44 +02:00
Avi Levin b384cd3f62 eo: Fix bad addressing in _eo_classes array
The header.id was masked before using it as index in the _eo_classes
array and was not unmasked when used.
It hasn't caused segfault (by sheer luck) but was wrong.

@fix
2015-01-08 14:29:07 +00:00
Daniel Zaoui bcd7736914 Eo: fix error handling when too many deletions invocations occur.
Before this fix, when a deletion was invoked twice on an object, a
wrong message ("...You wrongly call eo_unref() within a destructor...")
was printed. This was caused by the del_triggered flag that was not
resetted when the destruction finished.

This patch fixes this behavior by printing the right message on a double
deletion.
2014-12-05 03:38:16 +02:00
Jérémy Zurcher 18ceed4daf Eo: protect against recursive object destruction calls, fixes T1741
Summary:
    Eo: semantic obj->del replaced by obj->destructed
    Eo: protect against recursive object destruction calls
    Eo: add tests for bfada4b

Reviewers: JackDanielZ, tasn

Reviewed By: tasn

Subscribers: cedric

Maniphest Tasks: T1741

Differential Revision: https://phab.enlightenment.org/D1675

Fixes T1741

@fix
2014-11-18 15:25:34 +00:00
Tom Hacohen 2cd728373c Eo comp: Remove dead code following the composite fix.
This removes dead code resulting from Cedric's fix:
3550c38080.
2014-10-28 15:19:41 +00:00
Cedric BAIL 3550c38080 eo: fix composite to actually work.
So I don't really understand why the code was not there before, but it resulted
in my experiment of making a combobox for elementary just impossible. Now it
work at least.
2014-10-27 23:44:40 +01:00
Tom Hacohen 0b86334a85 Eo id: Fix id security checks for invalid objects.
In some cases, invalid object ids (e.g 0x1) would pass validation and
represent completely different objects (0x80...01). This happened because
we weren't properly checking a given object id is actually an object id.

@fix.
2014-10-22 11:31:10 +01:00
Tom Hacohen 01a487d881 Eo composite: Fix composite object functions to be eo functions.
For some reason, they were normal functions instead of eo functions,
which makes them harder to bind, less safe, and just wrong.
This commit fixes that.
2014-10-21 12:37:00 +01:00
Tom Hacohen 5db7a70603 Revert "Revert "Eo: Move eo_add_ref logic inside the library.""
This reverts commit 11da942184.

Can't reproduce with the non-existent bug report, thus have no choice
but consider it as working.
2014-10-10 09:30:52 +01:00
Mike Blumenkrantz 11da942184 Revert "Eo: Move eo_add_ref logic inside the library."
This reverts commit 8d16d8eb57.

this broke child object deletion in all the cases that I tested and regular object deletion in some cases as well
2014-10-09 21:07:30 -04:00
Tom Hacohen 8d16d8eb57 Eo: Move eo_add_ref logic inside the library.
It was a stupid lazy decision to leave it outside. Having it inside is safer
and cleaner.
2014-10-02 15:02:48 +01:00
Tom Hacohen bc6b6aa457 Eo: Better define the relationship of eo_add/del/ref/unref.
Now it's more clear and consistent. This commit complements the previous
eo_add commit (a7560dbc61).

Now eo_add should be matched with eo_del
eo_ref with eo_unref
eo_add_ref with eo_unref + eo_del

Essentially, the change is that if you have the ref to an object, you
need to unref it. Thus making ref/unref unneeded for most people who use
things (carefully) in c. If however, you would like to delete an object
previously created by you, you should eo_del (counter-part to eo_add).

It's still recommended you ref/unref when dealing with objects in
scopes, as you can't know when an object might just get deleted as a
by-product of another call.

This fixes an issue found by JackDanielZ.
2014-09-30 14:53:09 +01:00
Tom Hacohen a7560dbc61 Eo: Change eo_add/del/unref behaviour.
Before this change eo_add() used to create an object with 1 ref, and if
the object had a parent, a second ref.
Now, eo_add() always returns an object with 1 ref, and eo_add_ref()
    preserves the old behaviour (for bindings).

eo_unref now un-parents if refcount is 0, and eo_del() is an alias for
eo_unref (will change to be a way to ensure an object is dead and goes
        to zombie-land even if still refed).
2014-09-25 17:38:45 +01:00
Tom Hacohen 6846978ebd Eo: Get rid of eo_add_custom.
We decided to deprecate this one in favour of setting thing in the
construction between the constructor and the finalizer.
2014-09-25 10:30:56 +01:00
Tom Hacohen b33372b1f6 Eo do: simplify eo_do macro.
This moves the mainloop check inside the function. There was never need
for it to be in client code (i.e a header/macro).
This is better suited inside eo_do_start because this is a macro some
bindings have to re-implement, and we definitely don't want it to be any
more complicated than it has to be.

This breaks ABI and makes elm 1.12 depend on efl 1.11. This is not an issue
as because of eolian and interfaces it's already the case.
2014-09-23 14:36:20 +01:00
Jérémy Zurcher b3ffe9229a eo: call stack depth is 1024 2014-09-23 10:51:05 +02:00
Jérémy Zurcher 389c6d35f2 eo: call stack can grow/shrink when not using mmap
- if HAVE_MMAP call stack do not shrink and abort() when should grow
- otherwise it's a growing/shrinking stack using realloc
2014-09-23 10:47:24 +02:00
Jérémy Zurcher 88c5996dc1 eo: remove stack->max_size
- define EO_CALL_STACK_SIZE instead of stack->max_size
- we are talking about size here not maxsize
2014-09-23 10:43:36 +02:00
Jérémy Zurcher dc3add048f eo: remove XXX, it's ok now ... 2014-09-23 10:41:13 +02:00
Jérémy Zurcher a4c3299f41 eo: unify error msgs 2014-09-23 10:29:44 +02:00
Jérémy Zurcher 95e610d89a eo: call stack remove stack->dropcount
stack->shrink_frame does the same but more efficiently
change the value of EO_CALL_STACK_SHRINK_DROP if needed
2014-09-23 10:26:33 +02:00
Jérémy Zurcher 007efb5f05 eo: fix call stack shrink_frame
- do never shrink under EO_CALL_STACK_DEPTH_MIN size
- set shrink_frame at (current_size/2) - EO_CALL_STACK_SHRINK_OFFSET
2014-09-23 10:24:06 +02:00
Jérémy Zurcher 209a7506c3 eo: remove FIXME: Thread Local Storage
done in d39d7050
2014-09-23 10:21:26 +02:00
Daniel Kolesa 4875123472 eo: update the EFL to use builtin complex types 2014-09-09 14:21:39 +01:00
Cedric BAIL d86f094d67 eo: do not call eina_tls_get as often when in the main loop.
eina_tls_get is really slow, having a fast path for the main loop does really
help us right now. It is also unlikely that slowing down a little bit the use
of eo in thread is going to have any impact on application speed any time soon.

I win a +10% on expedite benchmark compared to without.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-09-04 18:11:45 +02:00
Cedric BAIL 68384fc7ef eo: let's be consistent and use the portable flag MAP_ANON. 2014-09-03 17:14:39 +02:00
Daniel Kolesa 46715c3574 eolian: move efl eo files over to the new ctor syntax 2014-09-01 15:53:35 +01:00
Tom Hacohen 2a0937b889 Eo base: Add a property to indicate if the object is finalized;
This enables checking if an object is being created, or has already been
finalized. This is useful in functions that you want to allow
only during the creation phase (i.e inside the eo_add()).
2014-08-29 10:26:23 +01:00
Daniel Kolesa 77d148cec9 eo: migrate constructors sections to constructing methods 2014-08-27 15:43:47 +01:00
Jérémy Zurcher ef91422e90 Eo: add missing field initializer 2014-08-22 10:09:58 +02:00
Daniel Kolesa 78acf69e20 eo, autotools: check for mmap feature rather than OS (mmap is POSIX) 2014-08-21 11:54:17 +01:00
Jean Guyomarc'h dc8e006e4f eo: mmap()/unmap() are also supported on OSX
Reviewers: raster, raoulh
@feature

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1240

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-08-21 12:04:53 +02:00
Daniel Kolesa 459638c2b9 eolian: more consistent syntax
"legacy foo" is now "legacy: foo" and "return foo" is now "return: foo".
2014-08-21 09:26:03 +01:00
Daniel Kolesa bb24b60638 eolian: generate implicit typedef for each class
And use these typedefs instead of just Eo in API.
2014-08-21 09:26:03 +01:00
Tom Hacohen ab38ffd6ed Eo base: Fix marking of eolian functions with EOLIAN. 2014-07-24 15:35:00 +01:00
Tom Hacohen 490eebabea Eo base: Mark class methods.
Use the new @class attribute to mark class methods.
2014-07-24 15:35:00 +01:00
Daniel Kolesa 3798eb2f99 eolian: move eina types to namespaced syntax 2014-07-21 16:30:23 +01:00
Daniel Kolesa c9744596de eolian: builtin bool type, and change the eo files to use that 2014-07-11 14:40:49 +01:00
Daniel Kolesa 53fb9515e9 eolian/generator: add asterisk on inout too 2014-07-08 14:15:36 +01:00
Cedric BAIL 3dcc172f57 eo: make parent_set a O(1) operation instead of O(n).
This does impact performance quite significantly when you have a lot
of children.
2014-07-06 13:15:21 +02:00
Tom Hacohen ac922d02e5 Eo abstract class: Fix namespace. 2014-06-30 17:47:06 +01:00
Tom Hacohen c19948c2cf Eo (base class): Fix .eo file to have proper namespacing for the class naem. 2014-06-30 17:47:06 +01:00
Daniel Kolesa 8221e9dd45 eolian: modify all eo files according to the new type syntax 2014-06-30 17:20:38 +01:00