Commit Graph

379 Commits

Author SHA1 Message Date
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
Daniel Kolesa e9f4890747 eolian: fix end-of-file checking, move namespaces from :: to . 2014-06-20 10:46:04 +01:00
Tom Hacohen 46b3643ff0 Revert "eo: replace composite_objects Eina_List with an array of Eo_Object*"
Comp objects are rare, and since we allow using classes as interfaces,
we end up allocating a lot of memory for something we don't even use.
That's why it was a linked list in the first place, and that's why it
should remain a list.

This is almost a complete revert. I reverted the code itself, and the
intent (use of array instead of list), but not the tests, or the new
return value added to comp_detach, which is useful.

This reverts commit ef09ef7489.
2014-06-13 18:20:24 +01:00
Jean-Philippe Andre 188ffd412c Eo: Fix crash on WIN32 (wrong check for NULL)
Thanks vtorri for the report
2014-06-10 14:57:58 +09:00
Daniel Zaoui 2160d0f27a Eolian/Generator: use a specific define for the Eo APIs.
The generation of EOAPI instead of EAPI for the Eo functions is only
needed for code readibility.
2014-06-10 07:57:09 +03:00
Cedric BAIL acc99074d1 eo: force zeroing memory on non Linux system.
@fix
2014-06-09 19:55:40 +02:00
Tom Hacohen 6eb3bda426 Eo base: Start generating eo_base from the .eo file. 2014-06-03 11:28:02 +01:00
Tom Hacohen 10626ff538 Eo: Fix and use the abstract class .eo file.
Until now it was just there, but never generated or used.
2014-06-03 09:19:19 +01:00
Tom Hacohen d9263e6571 Eo base: rename event_freeze_get to event_freeze_count_get.
This is needed because of a possible clash between the method event_freeze
and the property event_freeze with bindings.
2014-06-02 12:50:23 +01:00
Tom Hacohen 9f98ddae46 Eo: Fix docs of functions that have changed in eo2. 2014-05-30 14:54:10 +01:00