Commit Graph

1077 Commits

Author SHA1 Message Date
Marcel Hollerbach 1b39c772ea eina: prefetch for _eo_obj_pointer_get
Reviewers: raster, stefan_schmidt

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11603
2020-03-26 16:42:46 +00:00
Marcel Hollerbach 8e20d28dfe eo: move all call assignment
this improves the cache performance a lot. Caches are only invalidated
once, and not multiple times.

Reviewed-by: Carsten Haitzler (Rasterman) <rasterman.com>
Differential Revision: https://phab.enlightenment.org/D11592
2020-03-26 13:58:09 +01:00
Marcel Hollerbach 790a63c15f eo: there is no reason to equip for calls to classes
calls to classes are not needed anymore, since class inheritance is not
a thing anymore. After removing is_obj from the function the compile can
optimize the code better, since assignments to fields are not
conditionally anymore.

Reviewed-by: Carsten Haitzler (Rasterman) <rasterman.com>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11591
2020-03-26 13:58:07 +01:00
Marcel Hollerbach 39347f45aa eo: free vtable when erroring out
if there is a error when settings API to the vtable, free the vtable
instead of leaking it.

CID 1422015

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11580
2020-03-24 20:41:37 +01:00
Marcel Hollerbach 670cfb14fc eo: do not check this here
as coverity points out, _obj_is_override is already dereferencing
obj->opt so this was the wrong spot to check this.

CID 1422014
CID 1422013

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11579
2020-03-24 20:41:34 +01:00
Marcel Hollerbach d533bdbbac eo: fix wrong formatting
no functional changes.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11578
2020-03-24 20:41:30 +01:00
Marcel Hollerbach 8f09cf9dd3 eo: only really copy when there is content
otherwise we are allocating a 0 sized memory element, which is
pointless.
ASAN would report a 0 sized allocated but not freed element as a leak.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11577
2020-03-24 20:41:27 +01:00
Marcel Hollerbach 9762d75dc4 eo: correctly flag allocated memory
sometimes there is the chance that we need to allocate memory depending
on the functions that are defined, not on the types that are available.
However, even if this should only happen in error cases and on mixins,
we should ensure that this is all correctly freed flagged.

Due to the correct flagging here, we are not copying the memory later on
in a wrong way.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11576
2020-03-24 20:41:25 +01:00
Marcel Hollerbach 1b058695f5 eo: do no allocate a 0 sized segment
allocating 0 sized elements here is pointless.
This here was doing that, so ensure that we are only allocating vtable
nodes that have more than 0 function pointers.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11575
2020-03-24 20:41:22 +01:00
Marcel Hollerbach f80cfa4893 eo: do not NULL out the object itself
otherwise we would not free it in the next run over the vtable. Which
would result in a leak.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11574
2020-03-24 20:41:19 +01:00
Marcel Hollerbach 9738a75939 eo: do not null out the vtable chain of your own classes
the free methods here accidently took the top of the mro into account,
which is the class itself, which NULLed out the wrong classes.

After this, we are finally freeing the mixin vtables.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11573
2020-03-24 20:41:17 +01:00
Marcel Hollerbach 8f7a76a431 eo: do not allocate too much memory
when handoverwriting function on a object, only existing API can be
overwritten, but not newer ones. Thats why its enough to pass the size
of the klass, and not the size of the globally defined classes.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11571
2020-03-24 20:41:11 +01:00
Carsten Haitzler 9deee134c9 eo - fix err path for eo_isa to unlock shared objects
fix CID 1363294
2020-03-24 13:26:59 +00:00
Marcel Hollerbach 9f5ab4dea9 Revert "Revert eo vtale rework..."
This reverts commit efb15f510c.

The error that was causing this was in ector, and is fixed with the
previous commit.
2020-03-23 11:35:06 +01:00
Carsten Haitzler efb15f510c Revert eo vtale rework...
Revert "eo: redo vtable mro creation"
This reverts commit b05110609b.
Revert "eo: add a generic memory allocation tracking method"
This reverts commit 44071e3102.
Revert "eo: rework vtable allocation scheme"
This reverts commit 3bd16a46f1.
Revert "eo: do not allocate extension if deleting"
This reverts commit 64f7edc7fc.

This seems to breal vector rendering in lottie:

From: Hermet Park <hermetpark@gmail.com>
To: Enlightenment developer list <enlightenment-devel@lists.sourceforge.net>
Subject: Re: [E-devel] [EGIT] [core/efl] master 02/05: eo: rework
vtable allocation scheme

This patch occurs memory corruption, vector crashes :(
Here is a sample if you'd like to see it.
https://phab.enlightenment.org/F3858944
2020-03-23 09:07:08 +00:00
Marcel Hollerbach b05110609b eo: redo vtable mro creation
Summary:
up to now we have created the vtable of a class by walking the mro from
the most upper element to the klass itself. To give a broader view, the
mro of a klass X that extends the class Y and implements A,B,C,D

The mro of X is then equal to [A,B,C,D] + the mro of Y. Which means, we
can simply copy over the vtables of Y, and start walking at D, which
will result in the same vtable.

The sideeffect of doing that is, that we do not allocate that much
memory anymore. Reason for this is quite simple:
For every mixin that is part of the mro, we are copying the vtable node,
to insert new API implemented by the mixin. However, the resulting new
vtable is every time the same. Which means, we could actaully copy them.

The same messurements as in the previous commits are taken:
malloc tracking:
  new: 452128
  old: 556656
  Safeup: ~102 KB

pmap:
  new: 542884K
  old: 542168K
  Safeup: ~716 KB
Depends on D11538

Reviewers: zmike, stefan_schmidt, tasn, raster, woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11539
2020-03-21 00:01:29 +00:00
Marcel Hollerbach 44071e3102 eo: add a generic memory allocation tracking method
Summary:
this is super usefull when checking memory allocations. Esp. when
checking out new memory allocation schemes.
Depends on D11535

Reviewers: zmike, stefan_schmidt, tasn, raster, woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11538
2020-03-21 00:01:29 +00:00
Marcel Hollerbach 3bd16a46f1 eo: rework vtable allocation scheme
Summary:
with this commit a new way of allocating vtables arrived.
The old mechnism was to allocate a table big enough to carry *all*
functions at once, in order to not allocate that much memory for
functions that are not implemented on a specific klass, dichchains have
been used, which can be seens as a 2D matrix, where columns are only
allocated if min 1 entry needs to be written, this may have been a good
way to allocate back in the day when all this with eo started, however,
it showed to not pay off.

With this new way, we allocate a array of arrays. the first lvl array is
carrying enough slots, that *all* up to the time defined
interfaces/classes/abstracts/mixins can be implemented. The second lvl
array then has exactly the size of the defined APIs. The second lvl
array is obviously only allocated if needed.

When comparing the two methods, i messured two things, the usage based
on memory allocation for vtable-way-1 and vtable-way-2. Additionally, i
checked the overall memory usage of elementary_test using pmap. The
first messurement is a little bit more exact. The second messurement is
more biased, but captures the whole picture.

Memory allocation tracking:
   vtable-way-1 - vtable-way-2 = 74680 Byte

Pmap memory tracking:
   vtable-way1 - vtable-way-2 = 217088 Byte

The second messurement shows a bigger impact, likely because this is
also showing off all the sideeffects that we are taking place due to
fewer allocations.

Depends on D11524

Reviewers: zmike, tasn, stefan_schmidt, woohyun, cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11535
2020-03-21 00:01:29 +00:00
Marcel Hollerbach 64f7edc7fc eo: do not allocate extension if deleting
Summary:
->ext is getting freed during invalidate. If we unregister during
destruction (which is something that might happen) we should not
allocate the extension again.

Reviewers: woohyun, zmike, eagleeye

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11524
2020-03-21 00:01:29 +00:00
Xavi Artigas 5b2d2a85b2 doxygen docs: Fix tons of invalid Doxygen commands
Mostly typos
2020-03-10 21:36:34 +01:00
Xavi Artigas c6e40641aa doxygen docs: Miscellaneous typos 2020-03-09 09:35:40 +01:00
Xavi Artigas 645c3d41eb docs: Strengthen docs for Copy&Paste and Drag&Drop
Including Eina.Content

And a typo/bugfix in ecore_evas_x.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11204
2020-03-08 11:01:18 +01:00
Marcel Hollerbach 165f6f0ae2 rewrite efl cnp and dnd handling
the previous commits introduced a abstraction for drag in drop which can
be now used for this here. With this commit all the direct protocol
handling in efl.ui is removed, and only the ecore evas API is used.

Additionally, this lead to a giant refactor of how APIs do work. All
Efl.Ui. interfaces have been removed except Efl.Ui.Selection and
Efl.Ui.Dnd, these two have been restructored.
A small list of what is new:
- In general no function pointers are used anymore. They feel very
  uncompftable in bindings and in C. For us its a lot easier to just
listen to a event when a drop enters or leaves, there is no need to
register custom functions for that.
- Asynchronous data transphere is handled via futures, which proved to
  be more error safe.
- Formats and actions are handled as mime types / strings.
- 0 is the default seat if you do not know what else to take.
- Content is in general passes as a content container from eina, this
  also allows applications to pass custom types

The legacy dnd and cnp API is implemented based on that.
All cnp related things are in elm_cnp.c the dnd parts are in elm_dnd.c

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11190
2020-03-08 10:59:40 +01:00
Marcel Hollerbach f7e0a55d52 eo: print debug information when a call cannot be resolved
that is usefull esp. on parts.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11462
2020-03-06 15:11:20 +01:00
Xavi Artigas 9f4b5458ea doxygen: fix duplicated toc sections 2020-02-28 11:44:19 +01:00
Xavi Artigas ddbe32f2eb doxygen: fix missing end group tag 2020-02-28 11:44:19 +01:00
Felipe Magno de Almeida df0715a9aa C#: Add error checking for Eina.Success_Flag return type
When a get and/or set from property is defined to return, explicitly,
a Eina.Success_Flag, the mono generator will check the return value
and generate an exception if the call fails.
Resolves T8383.

Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11281
2020-02-18 17:53:19 -03:00
Carsten Haitzler 2636853b7f eo - fix - fix alignment of eo object class structs - it was wrong
the alignbment logic was wrong. we have to use the worst case. that
means 8 or 16 byte alignment. eina mempool alignment logic is wrong
for this as it assumes an array of typoes of all the same size...

this fixes crashes seen on armv7 with sigbus in new gesture code which
got unlucky.

@fix
2020-02-12 21:11:18 +00:00
Jérémy Zurcher bcdfe21e9e eo : fix 8e6e1860c3, _efl_object_event_future_scheduler_get(…) returns a pointer 2020-02-12 09:08:59 +01:00
Wonki Kim 8e6e1860c3 eo: remove potentional NULL dereferencing
Summary: this patch removes a potentional NULL dereferencing

Reviewers: jsuya, Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11325
2020-02-12 16:47:33 +09:00
Marcel Hollerbach 7f57e8e601 move stabelized items out of @beta
fixes T8570
fixes T8567
fixes T8566
fixes T8521
fixes T8501
fixes T8460
fixes T8455
fixes T8454
fixes T8254
fixes T7945
fixes T7944
fixes T7943
fixes T7942
fixes T7941
fixes T7940
fixes T7939
fixes T7938
fixes T7937
fixes T7936
fixes T7935
fixes T7934
fixes T7933
fixes T7858
fixes T7857
fixes T7856
fixes T7855
fixes T8599

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D11264
2020-02-05 08:58:22 +01:00
Xavi Artigas f6eed506d0 docs: Slight improvements to eina_types.eot Matrix docs
Reference D11158
2020-01-23 10:34:29 +01:00
junsu choi e7de16dc49 Eolian eina_types: Add Eina.Matrix4 type
Summary: for using in eolian

Test Plan: N/A

Reviewers: Hermet, bu5hm4n, segfaultxavi

Reviewed By: bu5hm4n, segfaultxavi

Subscribers: bu5hm4n, segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11158
2020-01-23 10:34:12 +01:00
Ali Alzyod 5137f6d143 eina: add new range Data type
Summary:
Introduce new data type (Eina.Range)  which represent range (part of series)

**eina_range_max_get**
**eina_range_intersect**
**eina_range_union**
**eina_range_contains**
**eina_range_equal**

Reviewers: cedric, woohyun, bu5hm4n, segfaultxavi, zmike

Reviewed By: woohyun

Subscribers: vtorri, cedric, #committers, #reviewers

Tags: #efl

Maniphest Tasks: T8570

Differential Revision: https://phab.enlightenment.org/D11133
2020-01-23 06:54:44 +09:00
Marcel Hollerbach 2f8029412d eina_types: declare unicode type stable
this is needed in order to get text stable.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11074
2020-01-13 15:57:29 +01:00
Cedric BAIL 115a9a22b1 eo: only forward event if someone is listening.
This limit long chain of useless event forwarding when nobody is listening
at the end of the pipe.

Differential Revision: https://phab.enlightenment.org/D10813
2019-12-11 10:36:02 +01:00
Stefan Schmidt d0f69cf2e2 exotic: remove left-overs from Exotic support
This seems to have been gone a long time ago and only references left
that have not been disturbing the build. Time to clean up!

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10793
2019-12-04 12:21:28 -08:00
Marcel Hollerbach 14b6f23cb3 eo: there is no need to count callbacks here
we are going to add this description anyways, no need to count here
again. I think this is not really making anything really faster, its
more keeping things consistance.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10689
2019-11-20 10:15:21 +01:00
Cedric BAIL 75301b3a1a eo: do not over compute the hash when propagating events.
This should slightly improve speed in theory. In practice, I have not seen
a benchmark which would budge by 5%, so I am not sure it improve speed that
much.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10660
2019-11-17 12:12:28 +01:00
Cedric BAIL 6d20f32cef eo: no need to oversize type.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10659
2019-11-17 12:12:26 +01:00
Cedric BAIL c355616043 eo: refactor shortcut for EFL_EVENT_DESTRUCT event.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10658
2019-11-17 12:12:23 +01:00
Daniel Kolesa 9ca573f40f eo: fix UB in the eo event code (edje_cc hangs etc.)
Today I started experiencing mysterious hanging of edje_cc
during build. "The French are at it again" I thought, and
after spending a while bisecting, I found the culprit.
It's 7f53d91583.

So, what is happening in here?

The idea here was fundamentally sound; compute a special
hash value for event descriptors, taking range between 0
and 63 (on 64-bit systems) and 0 and 31 (on 32-bit systems),
then use a mask sized 32-bit or 64-bit (depending on your
system) and check early if to bail out from callback_call,
saving some resources. So far so good.

The problem is in the way the mask is handled. We're applying
the hash as the shift value like, `x |= (1 << hash)`. On 32-bit
systems this is okay, but on 64-bit systems, C's dumb silent
coercion rules kick in, since the left side of the expression
is 1, a literal with type signed int; that means our shifting
range is limited to 31 and what we get is... undefined behavior.

This is obviously not what we want, so take a 1ULL value as a
base. The previous thing seemingly worked on x86_64 (nobody
reported any issues) and interestingly it worked for me too
for a while (on ppc64le), but undefined behavior can be
unpredictable, so...

This shouldn't need a commit message as long as this, but I'm
making it proportional to the amount of time I wasted on this.
2019-11-14 04:18:46 +01:00
Cedric BAIL 620dd43db2 eo: make sure to return the right value for efl_event_callback_call.
EINA_FALSE is to be returned only if one of the callback did call
efl_event_callback_stop not if their was no callback called.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10620
2019-11-07 22:24:07 +01:00
Marcel Hollerbach 1a621c9109 eo_base_class: move shift init to the first call
Summary:
this cannot be evalulated in compile time, so this must be evalulated in
runtime, at the first call.

This should fix OSX build.

Co-authored-by: Cedric Bail <cedric.bail@free.fr>

Reviewers: zmike, cedric, raster

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10582
2019-10-31 12:48:27 -04:00
Cedric Bail ff14c84fcb eo: add debug ability to detect long chain of event handler.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10484
2019-10-31 14:52:56 +01:00
Cedric Bail db93501e66 eo: reduce memory use to track event registration and callback call.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10482
2019-10-31 14:52:52 +01:00
Cedric Bail 474b1b2c2d eo: add infrastructure to attach an Eina_Future_Scheduler to any source of event.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10480
2019-10-31 14:52:46 +01:00
Cedric Bail 2401dae848 ecore: remove unecessary field in data structure.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10476
2019-10-31 14:52:35 +01:00
Cedric Bail 7f53d91583 eo: prevent unecessary callback call walk.
This patch introduce a small hash (64 or 32bits) that cache all existing
Efl_Event_Description callback handler registered on an object. It slightly
reduce the time needed to do an unecessary call and cost just a few bytes
per object.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10475
2019-10-31 14:52:31 +01:00
Mike Blumenkrantz 8218fb0e20 eo: block "invalidate" event emission when there are no subscribers
Summary:
this should be handled like the rest of eo internal events

ref T8321
Depends on D10353

Reviewers: bu5hm4n, cedric

Reviewed By: bu5hm4n, cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10354
2019-10-14 09:29:30 -04:00