Commit Graph

1406 Commits

Author SHA1 Message Date
Marcel Hollerbach 40a62ddf94 eina: introduce Eina_Abstract_Content
A little abstraction to have abstract data content bound to a type.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D11018
2020-03-08 10:59:22 +01:00
Xavi Artigas 43f98b2d46 doxygen docs: Fix several group problems
@ingroup before @addgroup, circular group dependencies...
2020-03-03 18:49:20 +01:00
Marcel Hollerbach 76cc9488dd efl_ui_spotlight_scroll: improve scroll behaviour
when the mouse motion was used, we need to mark this event as processed.
Otherwise a click event will be emitted which is wrong.

Additionally, we should only scroll when we are definitly not clicking.
Right now, the scrolling animation would dance arround on a real TS.

Additionally², this commit introduces a little macro which calculates
the distance of a position.
2020-03-02 17:24:33 +01:00
Carsten Haitzler 559bbd8ce3 freeq - up numbers for fq blocks and other limits to defer big batches
this should improve some perf by upping the max a free queu can baloon
up to 256k items and 32m of data (whichever is hit first).
2020-02-28 20:03:05 +00:00
Xavi Artigas 9f4b5458ea doxygen: fix duplicated toc sections 2020-02-28 11:44:19 +01:00
Christopher Michael 104e98d2ee eina: Fix warnings about unused variables on Windows
NB: Patch from vtorri
2020-02-23 07:38:05 -05:00
Xavi Artigas c2738b4ed9 docs: A bit more info and formatting for Eina_Process_Cb
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11063
2020-02-19 16:34:08 +01:00
Marcel Hollerbach 74491e8781 eina: introduce eina_iterator_process
this brings a functional-map function to the iterator implementations.
https://en.wikipedia.org/wiki/Map_(higher-order_function)

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D11062
2020-02-19 16:34:05 +01:00
Marcel Hollerbach 6c251b2d01 eina_array: interpret the count of a NULL array as 0
this makes the usage way more convinient.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D11373
2020-02-19 16:28:08 +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 bddb538563 eina file - close on exec - doesnt exist on windows - vtorri 2020-02-15 11:20:38 +00:00
Yeongjong Lee fff6ce7f2e eina_rbtree: avoid defererencing null pointer
Summary: Pointer 'it->stack' is dereferenced at `_eina_rbtree_iterator_free`.

Reviewers: Hermet, zmike

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11346
2020-02-14 18:18:20 +09:00
Carsten Haitzler 6981d09f9b eina - promise - be safe if no scheduled_entry is there
something is causing a scheduled entry to be called with no scheduled
entry: https://phab.enlightenment.org/T8490 - valgrind trace
aattached. i can't see it so i don't know what. the only protection i
can put in is this.
2020-02-12 09:53:22 +00:00
Lucas Cavalcante de Sousa fdbc2a5b32 efl: `eina_value_list_vinsert` assumes that the position is always valid
Summary:
The eina_value_list_vinsert at src/lib/eina_inline_value.x was not checking if the desired position was valid:
When inserting in an empty list in any out of bounds position it actually createded a list with the head being the desired value.
When inserting in a non-empty list in an out of bounds position caused a c error.
Now both cases return EINA_FALSE

Ref T8611

Test Plan:
Meson configured with -Dbindings=mono,cxx -Dmono-beta=true, and tests runned
with ninja test all.

Reviewers: felipealmeida, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8611

Differential Revision: https://phab.enlightenment.org/D11301
2020-02-07 13:52:15 -05:00
Cedric BAIL 5d20a3bc6d eina: do not warn when calling eina_inarray_pop on empty inarray to match eina_array_pop.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11253
2020-01-31 10:11:33 -08:00
Cedric BAIL 373f2ad797 eina: add eina_future_all_iterator and eina_promise_all_iterator.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11180
2020-01-31 10:11:31 -08:00
junsu choi d1660bdfe5 eina_matrix: Add eina_matrix4 operator(translate, rotate, scale)
Summary:
Add an operator related to the 3D transform in eina_matrix.

enum eina_matrix_axis
  EINA_MATRIX_AXIS_X
  EINA_MATRIX_AXIS_Y
  EINA_MATRIX_AXIS_Z
eina_matrix4_translate
eina_matrix4_scale
eina_matrix4_rotate
eina_matrix4_transpose

Test Plan: src/tests/eina/eina_test_matrix.c

Reviewers: Hermet, bu5hm4n, kimcinoo, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11159
2020-01-29 15:31:07 +09: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
Carsten Haitzler ee6cc91a03 eina - fix eina_strndup test passing 2020-01-15 19:23:44 +00:00
Carsten Haitzler eb72593bbc eina - rmeove dup EINA_PRINTF
sorry for the noise...
2020-01-15 18:10:24 +00:00
Carsten Haitzler ffb6085816 eina - eina_strndup - use universal impl because strndup is an issue
freebsd/clang report strndup is not defined and string.h doesnt seem
to help if its included so move to the universal re-implementation
that was there for win32 anyway
2020-01-15 19:06:07 +01:00
Carsten Haitzler d990ab7dba eina - enable EINA_PRINTF for clang as well as gcc 2020-01-15 19:06:07 +01:00
Woochanlee a2084ba22e eina_hash: Move hash_free_cb to avoid memory leak.
Call hash_free_cb after finish deletion.

ref T8530

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10918
2019-12-19 15:48:17 -08:00
Marcel Hollerbach 9ccc66b900 eina_accessor: make carray accessor work properly
a accessor is not really helpfull if it operates like the carray
accessor before this commit. What it was doing is to fill the content of
the "current line" into the data pointer. In a carray the
"current line" is the content of its carray-member.

However, accessors like for inarray array list or inlist do work
completly differently. They are returning the pointer to the "current
line" not the value of the current line.

The only case where this worked is efl_ui_format.c which was only tested
with this accessor, and this accessor also only worked with this
accessor.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10908
2019-12-18 21:45:42 +01:00
Woochanlee 0902bb4e01 eina_rbtree: Clean array intead of flush.
It doesn't have to flush all of the time when it iterating.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10858
2019-12-11 09:59:59 -08:00
Cedric BAIL e4765e3806 eina: introduce an explicit eina_cow_done with no call to GC.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10817
2019-12-11 10:36:14 +01:00
junsu choi ab67611c65 eina_inline: Fixed a potential dangling pointer
Summary: fixed by null handling

Test Plan: N/A

Reviewers: Hermet, YOhoho, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10850
2019-12-11 09:27:10 +09:00
Wonki Kim a8d7816782 docs: fix to make docs contain proper images
Summary:
links to images that this patch is modifying would be included in doxy docs
without pre or post process something in meson definition, if we applied this patch.

Reviewers: segfaultxavi, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10821
2019-12-10 12:53:39 +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
Stefan Schmidt f3d9b8ee70 esacpe: remove library from tree
This has not been used for a while and is not even buildable after our
switch to meson. It was a niche to start with given that it needed the
PS3 OS to run on. I asked for any remaining users at EDD and on the list
but heard nothing. Time to remove.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10778
2019-12-04 12:21:24 -08:00
Carsten Haitzler 7787b16e20 eina - threadqueue - revert series of comments that moved to mempools
Revert "eina: remove no longer used function _eina_thread_queue_msg_block_real_free"
This reverts commit 695b44526c.

Revert "eina/threadqueue: use mempool_del for hash free function"
This reverts commit b0cb3b935a.

Revert "eina_thread_queue: use normal mempools for block allocation"
This reverts commit 14ae3e3dec.

Why? Threadqueue is a highly performance sensitive API.
_eina_thread_queue_msg_block_new() may be called quite often. Doing a
hash lookup to then find a mempool handle to then allocate from was
not the same as what was there and was going to be far more costly.
This would have actual performance impact as we have to compute a hash
and rummage through a hash, hunt for an environment var too. The
original code looked at a spare block pool where blocks *MAY* be of
different sizes (not always the same size so using a mempool is
actually wrong and will stop threadqueue from being able to send
larger messages at all). If you send large messages, larger blocks would
have been allocated and put in this pool. In almost all cases the first
item in the pool would be big enough so we don't hunt and the find pulls
out the first memory, resets the fields that are needed and returns that
block. If it needs a bigger one, it does hunt. This is going to be
rare that such big blocks are needed so I never tried to optimize this
(but it could be done with an array of sizes to make a walk to find
the right sized element cheap if the need arises).

Performance dropped quite a lot. On aarch64 The above mempool usage
dropped message rate from 1037251 msg/sec to 610316. On x86 it was even
worse. It dropped from 2815775 msg/sec to 378653.

So backing this out sees the message rate is 7.4 times faster and on
aarch64 it's 1.7 times faster.

So moving to a mempool was actually just wrong (size is not always the
same). Also this ended up with a mempool of 64k for thread queue blocks even
if we only sent messages sporadically, as opposed to a single 4kb
block. So backing this out saves memory by only having 1 or 2 4k blocks
around most of the time, not a 64k mempool.

So the above patch then follow-on patches were done without accounting
for the performance implications. There were good reasons to do what I
did - because this code was highly tuned even to the point where I
used atomics instead of locks specifically to cut down some contention
overhead. Beware when you change something that there may be steep
performance implications. 7.4 times faster to go back to what was
there is a great example.
2019-12-03 11:45:42 +00:00
Carsten Haitzler 1127409564 eina - add portable close all fd's we don't need function
close all fd's starting at a given fd and then leving out an exception
list specially passed, if any. useful for fork+exec. this uses it in
efl's fork+exec paths.

@feat
2019-11-27 16:52:49 +00:00
Wonki Kim 4a4525cb4b eina_matrix: replace cosf by cos to gain more accuracy
Summary:
cos function is much much more accurate than cosf.
this patch replaces cosf by cos to gain more accuracy.

Reviewers: cedric, jsuya, vtorri

Subscribers: vtorri, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10695
2019-11-21 17:50:33 +09:00
junsu choi 3493a37db8 Eina_Matrix : Use math header for cosf and sinf of rotate function.
The local cos and sin functions differ from
the math header cos and sin functions by result values
The 4th decimal place is different.
Computing large numbers can cause errors.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10467
2019-11-15 11:52:01 -08:00
Marcel Hollerbach f47b927745 efl_canvas_animation_rotate: adjust API
Summary:
in task T8288 we concluded that a few APIs need to be adjusted in order
to stabelize animation classes at some point. This also adds a new macro
to eina in order to create EINA_VECTOR2 values more easily.

ref T8288

Reviewers: Jaehyun_Cho, segfaultxavi, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8288

Differential Revision: https://phab.enlightenment.org/D10350
2019-11-04 13:06:53 +01:00
Cedric Bail 2f1894d054 eina: only the type need to be NULL to assume EINA_VALUE_EMPTY.
This avoid comparison with potentially uninitialized byte.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10479
2019-10-31 14:52:41 +01:00
Cedric BAIL efbc90ff87 eina: make use of the new near allocation policy for Eina_List.
The idea is to improve memory locality and hopefully get better cache hit
in general.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10536
2019-10-30 08:14:28 -07:00
Cedric BAIL fb5cf01977 eina: introduce an API for requesting memory near already allocated memory from an Eina_Mempool.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10535
2019-10-30 08:14:27 -07:00
Mike Blumenkrantz f4019d3303 eina: add comparison macros for Eina_Size2D and Eina_Position2D
Summary:
I'm tired of typing all this out. it's exhausting.

also add a couple usages internally to verify that this works as expected

@feature

Reviewers: cedric, bu5hm4n, devilhorns

Reviewed By: devilhorns

Subscribers: devilhorns, bu5hm4n, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10557
2019-10-29 14:52:58 -04:00
Daniel Kolesa 079b1f05b1 eina: remove eina_config.h.in
This is never actually used since meson generates eina_config.h
from scratch. Apart from the byteswap checks done in the previous
commit, all of the other things already seem to be done by meson,
so just remove it.
2019-10-23 15:51:34 +02:00
Daniel Kolesa 84251f9f00 eina: unbreak byteswap checks
For one, eina_config.h.in is never used by anything since meson,
so doing any checks in it and expecting them to work is wrong.
Byteswaps are one place where this is the case, so move the
checks back in their appropriate place.
2019-10-23 15:51:08 +02:00
Daniel Kolesa 038539176c eina: fix network byte order swap funcs on big endian 2019-10-22 10:59:42 +02:00
Mike Blumenkrantz c81e4d5080 eina/convert: init endptr in failure case of eina_convert_strtod_c
Summary:
there is not any way to determine that this function has failed other
than to check this pointer, so ensure that it always has a value which
is meaningful in failure cases

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10445
2019-10-18 13:29:32 -04:00
Mike Blumenkrantz cd97c2a0b7 eina/list: move dead code inside corresponding #ifdef
Summary:
this is debug code

CID 1404753, 1404745
Depends on D10204

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10205
2019-09-26 17:59:29 -04:00
Vincent Torri e79d6bd0af eina_array: do not mix declaration and definition
fix warning when used in C90 code.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D10077
2019-09-23 16:43:54 +02:00
Marcel Hollerbach b6c713c937 eina_log: ensure that we do not spam journald with our intree binaries
EFL_RUN_IN_TREE is set for all binaries that are executed during build
time, and test suites. With this commit we are ensuring that we are not
sending messages during that time to journald, otherwise we would waste
a lot of time + we would create a lot of unneccessary log messages.

(eina test suite runtime with journald hook: 11.21s without journald
hook: 0.57s)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10076
2019-09-23 15:52:27 +02:00
Marcel Hollerbach 5ff0c3cc15 eina_log: do not fallback to INFO when we run with systemd support
INFO is a way too verbose log domain, this lead to the fact that we
spammed journald before the first frame with ~200-300 messages
(depending on the setup) which is quite a lot. Additionally, this also
lead to the fact that we often TIMEOUT our own tests.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D10075
2019-09-23 11:50:43 +02:00
Cedric Bail 2fdad92948 eina: add code to help debug leaking Eina_Value.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9942
2019-09-19 14:37:43 -07:00
Cedric Bail 9382bfc0bc eina: add eina_mempool_iterator_new to slowly iterate every allocated pointer in a mempool.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9941
2019-09-19 14:37:41 -07:00
Cedric Bail 94e9363649 eina: prevent leak of Eina_Value internal allocation.
eina_value_copy assume the given Eina_Value as target is not initialized
when it copy the source in it. In eina_value_reference_copy we were initialising
before calling eina_value_copy which would then override and leak the internal
pointer no fault of the users.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9943
2019-09-17 10:24:08 -07:00
Stefan Schmidt 1d0a636953 eina: fix spelling in new eina_file_statgen API
Introduced in 9b294d6284 the new eina_file_statgen_* API has a typo in
its disable function. Fixing this before it gets out into a release.

Thanks goes to the https://abi-laboratory.pro service for offering their
great API/ABI reports to the open source communities to help finding such
things!

Differential Revision: https://phab.enlightenment.org/D9962
2019-09-16 12:02:42 +02:00
Wonki Kim 979757c845 eina_vpath: add null checking logic on vpath_resolve api
Summary:
there is a patch that add vpath_resolve() call before eina_file_open()
because `path` arg could be NULL, the patch kills some applications.
this patch add null checking logic on vpath_resolve api

Reviewers: bu5hm4n, cedric, Hermet

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9748
2019-08-27 20:25:02 +09:00
Wonki Kim 4c489d5a2e eina_list: fix to check a null argument
Summary:
data should be checked regardless of EINA_MAGIC define,
because it is dereferenced in the following logic.

Reviewers: cedric, bu5hm4n, Hermet

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9750
2019-08-27 20:23:29 +09:00
sub.mohanty@samsung.com 5bd95c9850 eina/array: added eina_array_find() api to eina_array.
Summary: updated test suite for testing the api.

Reviewers: zmike, Hermet, cedric, segfaultxavi

Reviewed By: zmike, segfaultxavi

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

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9734
2019-08-26 08:31:08 -04:00
Carsten Haitzler 2be2c3c6c3 eina list - make eina list magic optional and for now turn it off
this should bring our list nodes back to 32bytes (or 16 on 32bit)
which is the rounded up libc allocation size anyway expected. less mem
usage but less safety. i haven't seen any magic complainets to do with
eina list for a while now... so let's see.
2019-08-21 20:02:24 +01:00
Vincent Torri 01b987df59 make mman.h private
Summary:
integrate mman.h to make Evil private to the EFL, as mman.h does not exist on Windows. After a discussion with raster, i include sys/mman.h only on non Windows platform.

One issue, though, is that src/modules/emotion/generic/Emotion_Generic_Plugin.h has inlined functions using mmap()

Test Plan: compilation on Windows

Reviewers: cedric, raster, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9542
2019-08-19 09:55:13 -04:00
Carsten Haitzler 807c8e7357 eina file - don't double unlock a lock
thanks to coverity - found this double unlock path in case of error.

fix CID 1403899
2019-08-11 12:47:38 +01:00
Carsten Haitzler fd48be23c2 eina file - make coverity happy and lock+unlock on init
coverity doesnt like inconsistent behavior of code, so make it
consistent even  if pointless as this is during init when we wont have
threads .... yet.

CID 1403903
2019-08-11 12:47:38 +01:00
subhransu mohanty da39f53b95 eina/hash: optimize eina_hash_find() when hash is empty.
Summary:
Check if hash is empty before computing the hash key and look inside the
hash to find data.

Note: could have called the eina_hash_population() api but didn't
      because of extra function call.

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9531
2019-08-09 14:00:03 +09:00
Carsten Haitzler 9149767184 getenv - reduce continually calling getenv for the same vars do once
do it once and remember the result from the first one. drops overhead
for sure by a chunk i actually could see in perf reports like about 1-2%
of cpu...
2019-08-08 23:57:02 +01:00
Carsten Haitzler 5f1e44ddad eina log - we exceet 24 domains alrready out of the box, so increase
this avoids more reallocs since we already use more than 24 domains...
go up to 64.
2019-08-07 21:20:00 +01:00
Carsten Haitzler 9b294d6284 eina file - stat generation inexactness support
this is a performance optimization. it brings in a "stat generation".
for now it's disabled by default so we retain previous behavior. this
stops eina file from opening and stating a file every time you open
... it only does it if stat generation is off, or, if the generation
changed since the last time it opened that file. this makes cache hits
not have a 3 syscall cost (open+fstat+close). this optimizes that
lower end of things path. but .. it comes at a cost. if the file
changes before generation ticks over (which this forces to tick over
every time the loop exits idle by default).

now here is something to ask.

1. should we have this on by default and accept the "inexactness"
since you can eina_file_statgen_next() before any call that would do
i/o to force it to look at the real file stat info...
2. should we tick over every idle enter OR every N idle enters  or
every frame we render instead? ... i want to avoid getting a timestamp
or having a timer interrupt often... so what should we do?

at least this introduces the idea, some api's and an env var to turn
this on. it definitely cuts down syscalls during things like creation
of widdgets or objects in large batches etc.
2019-07-28 11:51:15 +01:00
Vincent Torri a6ade14c5e Evil: remove pwd code in Evil and fix compilation failures after the removal
Summary: remove pwd code in Evil

Test Plan: compilation

Reviewers: zmike, cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9420
2019-07-28 09:27:27 +01:00
Vincent Torri 04848c98f2 Eina: define EINA_HAVE_DEBUG_THREADS only if backtrace() in execinfo.h is available
Summary: fix compilation on systems where backtrace() in execinfo.h is not available

Test Plan: compilation on Windows

Reviewers: zmike, cedric, raster

Reviewed By: cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9392
2019-07-28 09:21:53 +01:00
Carsten Haitzler d19e435ff9 reduce syscalls on opening files - roll CLOEXEC into open
on linux open supports() O_CLOEXEC. add test case for this in meson
build and ifdef. this rolls 3 syscalls into 1 as we were doing open,
then fnctl to get and fcntl to set flags.

less syscalls is a good thing as syscalls are not cheap on some
architectures or systems. I've seen a syscall on 1 system take 2-3x
as long as another and another syscall in the same 2 system
comparison take 10x as long. depending on the syscall you may only
have a budget of something like 5000 syscalls "per frame" (60fps)
before you spend all of your frame time just in syscalls not
doing any processing, so we should keep these down if possible
and that is what this does.
2019-07-26 11:43:17 +01:00
Carsten Haitzler 0cd5427c3f build - cmake files - remove old seemingly unused cmake files 2019-07-24 17:53:09 +01:00
Mike Blumenkrantz 481747ae33 meson: fix debug-threads option
it doesn't matter if this doesn't work with eina_debug since this isn't
meant to be used for that kind of debugging

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9359
2019-07-19 15:04:48 -07:00
Vincent Torri 89db9df2d2 Eina vpath: remove support of ~username vpath on Windows
On Windows, one must be in kernel mode to obtain informations of other users

Reviewed-by: Carsten Haitzler (Rasterman) <rasterman.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9339
2019-07-18 09:36:25 +02:00
Cedric BAIL c46a814391 eina: set EINA_VALUE_EMPTY during library init.
This is a work around compiler/linker limit on some system as reported
by Romain Naour.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9348
2019-07-17 14:23:09 -07:00
Mike Blumenkrantz 662572ecfe eina/hash: add direct variants of list append/prepend functions
Summary:
this simplifies the process of manipulating lists inside hashes with a
non-copied key

@feature

Depends on D9205

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9206
2019-07-10 14:40:42 -04:00
Marcel Hollerbach 223a433be8 eina: add accessors for c arrays
This adds a new API which can be used to get access to a carray via the eina_accessor API.
2019-07-03 07:41:05 +02:00
Marcel Hollerbach bed3fa5904 meson: remove unneeded install: flags
Summary:
when install is not set, meson take the value of install_dir. So when
this is removed, things will continue working correctly.

Reviewers: zmike, stefan_schmidt, cedric, segfaultxavi

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9065
2019-06-03 08:46:29 -04:00
Cedric BAIL 2a3bf30abc eina: add eina_slstr_copy_new_length.
Reviewers: SanghyeonLee, bu5hm4n, zmike, segfaultxavi, lauromoura, felipealmeida, raster

Reviewed By: bu5hm4n, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7832

Differential Revision: https://phab.enlightenment.org/D8800
2019-05-29 13:49:26 -04:00
Mike Blumenkrantz 9c2547db0c eina/prefix: ignore magic files when running in tree
Summary:
this just can't work.

@fix
Depends on D8951

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8952
2019-05-29 12:29:03 -04:00
Mike Blumenkrantz 655c816539 eina/file: use INFO log level when eina_file_open fails
Summary:
this function is commonly used to detect the existence of files using
its return value. for this purpose, printing warnings any time the file
cannot be opened is spammy and not very helpful in the context of detecting
actual errors.
Depends on D8950

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8951
2019-05-29 12:29:03 -04:00
Marcel Hollerbach 1f0ae2e349 eina: move builtin detection to eina_config.h
Summary: this means we don't need to handle this in the buildtool at all.

Reviewers: vtorri, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8553
2019-05-21 12:28:47 -04:00
Vincent Torri ce9cad3a3b Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary
Test Plan: compilation

Reviewers: raster, zmike, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8903
2019-05-16 13:48:59 -04:00
Vincent Torri 59f8516ec5 eina vpath: fix warning on Windows, as well as the public path
Differential Revision: https://phab.enlightenment.org/D8866
2019-05-12 11:56:04 +02:00
Cedric BAIL 370917751f eina: update vpath to also support a more classic syntax for variable.
This enable vpath to recognize also ${} as a variable. It does mimic
what Efl.ViewModel provide with Efl.ViewModel.PropertyText and various
other language.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8883
2019-05-11 08:52:07 -07:00
Cedric BAIL 9c992c05d5 eina: refactor and simplify vpath.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8882
2019-05-11 08:52:05 -07:00
Cedric BAIL eb1d47349b eina: always initialize all the field of Eina_Value used by Eina_Promise.
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8794
2019-05-09 09:33:27 -07:00
Vincent Torri b141c42e3f Evil: remove wrapper around getcwd()
Summary: getcwd() is declared in direct.h

Test Plan: compilation

Reviewers: raster, cedric, zmike

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8858
2019-05-08 08:39:36 -04:00
Vincent Torri 770cede2bf eina_file: speed up listing of directories on Windows
Summary:
forbid the creation of short name (legacy of DOS)

Without optimisation

1. using only Win32 API, just iterating over directories (in micro seconds) :
  10 files : 47
  1000 files : 270
  100000 files : 73227
2. using eina_file_dir_list() with a callback which does nothing :
  10 files : 53
  1000 files : 265
  100000 files : 69624

usually there is a small overhead for eina API, which is normal

With optimisation

1. using only Win32 API, just iterating over directories (in micro seconds) :
  10 files : 51
  1000 files : 256
  100000 files : 33345
2. using eina_file_dir_list() with a callback which does nothing :
  10 files : 53
  1000 files : 251
  100000 files : 33832

speed up with 1000 files and more. Twice faster with 100000 files

Test Plan: benchmark program

Reviewers: raster, cedric, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8842
2019-05-07 11:15:54 +01:00
Mike Blumenkrantz f254cff545 eina: explicitly include Evil.h in eina_inline_slice.x
this file is included by itself (without Eina.h) so it must also include
its dependency headers

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8727
2019-05-06 17:00:50 +02:00
Vincent Torri 7db4714db6 replace strndup with eina_strndup, remove strndup definition in evil and elm_test_dnd
Test Plan: compilation

Reviewers: cedric, zmike, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8814
2019-05-03 13:13:57 +01:00
Vincent Torri e2634eec67 Eina: add eina_strndup() API as inlined function
this add strndup implementation that does not seg fault when string is NULL.
This also implements strndup on Windows.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8790
2019-05-01 17:57:36 -07:00
Vincent Torri 93070e4f0f eina_unicode: return NULL if allocation fails
Reviewers: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8785
2019-04-30 09:24:48 +01:00
Marcel Hollerbach 60af618098 eina_vpath do not pass things through snprintf when not expected.
lets assume a user passes in a string like "blabla%dehydra" then %d will
be resolved by snprintf. Which is probebly not what we want. This
resolves this case and ensures that eina_vpath_resolve does not get
piped through snprintf

Reviewed-by: Dave Andreoli <dave@gurumeditation.it>
Differential Revision: https://phab.enlightenment.org/D8753
2019-04-27 12:31:39 +02:00
Cedric BAIL 805128dbf3 eina: allow copy of EINA_VALUE_EMPTY type.
This is usefule to allow timeout future to be propagated through eina_future_all
or eina_future_race for example.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8655
2019-04-26 11:32:40 -07:00
Carsten Haitzler 70a7dfff46 eina vpath - fix windows warning as simply as possible
the warning is wrong - so keep things simple
2019-04-18 11:33:40 +01:00
Carsten Haitzler f81dfbfe64 eina vpath - clear up vpath to handle env vars that are too big as fatal 2019-04-17 17:44:12 +01:00
Vincent Torri a30caf333e eina_vpath: port to Windows
Test Plan: test example

Reviewers: raster, cedric, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8633
2019-04-17 17:44:12 +01:00
Xavi Artigas 68c530080b docs: Fix common misspellings in H files
Fixed all appearances of words from this list in H files:
https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2019-04-02 13:28:48 +02:00
Mike Blumenkrantz 69c54cdabb eina_log: reset logging callback to default when null is set as the callback
Summary:
passing null here causes any log message to crash the app and is probably not
the intended result

Reviewers: cedric, segfaultxavi

Reviewed By: cedric, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8513
2019-03-29 18:57:06 +01:00
Cedric BAIL e859130dd4 eina: prevent double cancel of ongoing dispatched future.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8333
2019-03-27 15:03:08 -07:00
Cedric BAIL 7331f21ea7 eina: always initialize i.
Reviewers: zmike, bu5hm4n, stefan_schmidt, devilhorns

Reviewed By: devilhorns

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8451
2019-03-26 12:05:02 -04:00
Vincent Torri 12e0ee8742 eina_error: On Windows strerror_s() is the same than POSIX strerror_r()
Summary: strerror_r() does not exist on Windows, but strerror_s() does

Test Plan: compilation

Reviewers: cedric, bu5hm4n, zmike

Reviewed By: zmike

Subscribers: zmike, bu5hm4n, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8279
2019-03-13 09:53:17 -04:00
Mike Blumenkrantz 598ce966d8 eina_file: set errno on open fail for win32 build
Summary:
windows does not automatically set errno so we must do it ourselves

@fix
Depends on D8103

Reviewers: vtorri

Reviewed By: vtorri

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8104
2019-03-06 08:37:29 -05:00
Carsten Haitzler b92f09b1d2 eina vpath - change XDG_PUBLIC_DIR to XDG_PUBLICSHARE_DIR
match the spec correctly.
2019-03-05 13:02:56 +00:00
Carsten Haitzler 272d1b5fc2 eina vpath - document that resolved strings need to be freed 2019-03-05 12:12:32 +00:00