Commit Graph

48 Commits

Author SHA1 Message Date
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 8a7cb97e02 Eina: implement strtod in C locale and remove linkl against msvcr100.
Summary:
This fixes compilation on Windows

More precisely edje_cc could not compile emotion edc files, so it was a runtime problem
because of msvcr100 link.

Add more tests than before

Test Plan: compilation

Reviewers: raster

Subscribers: zmike, stefan_schmidt, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7926
2019-02-28 14:36:42 +01:00
Marcel Hollerbach 6c8cebf403 Revert "Revert "eina: add locale-independent eina_convert_strtod_c function""
This reverts commit ddd2638758.
2018-12-05 11:17:53 +01:00
Stefan Schmidt ddd2638758 Revert "eina: add locale-independent eina_convert_strtod_c function"
This reverts commit bef1c5cc43.

The commit breaks the build on macos. I gave it soem time to get fixed
up quickly, but its late Friday night in Korea now and this is unlikely
to get fixed until Monday. Revert here until fixed.

./src/lib/eina/eina_private.h:158:1: error: unknown type name 'locale_t'

https://travis-ci.org/Enlightenment/efl/jobs/461790674
2018-11-30 15:30:01 +01:00
Youngbok Shin bef1c5cc43 eina: add locale-independent eina_convert_strtod_c function
strtod's behavior is changed by system locale.
http://man7.org/linux/man-pages/man3/strtod.3.html
https://en.wikipedia.org/wiki/Decimal_separator

Because of this, strtod(0.5) returns 0.0 in some locales.
When a given value string is locale-independent, strtod has to be
replaced to eina_convert_strtod_c function.
Internally, it calls strtod_l function with "C" locale.

@feature

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Differential Revision: https://phab.enlightenment.org/D6644
2018-11-29 16:15:59 -08:00
Marcel Hollerbach cf74462b76 eina_debug: switch to vpath
Summary:
eina debug was using the xdg runtime dir in a wrong manner. Since the
directory should be only used by the user, and the directory should be
be subject of any other usage. Additionally, apps tend to create files
like: $XDG_RUNTIME_DIR/foo.bar which is probebly not what you want in
$HOME.

ref T7107

Depends on D6747

Reviewers: zmike, stefan_schmidt, #committers

Reviewed By: zmike, #committers

Subscribers: #reviewers, cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7107

Differential Revision: https://phab.enlightenment.org/D6748
2018-08-20 12:59:15 -04:00
Mike Blumenkrantz c043f55a43 eina: prevent threads subcomponent from being shutdown while eina is active
this basically breaks all thread usage if it happens, so ensure that the
threads infrastructure stays active for as long as eina is active

@fix

Differential Revision: https://phab.enlightenment.org/D6303
2018-06-19 13:55:36 -04:00
Mike Blumenkrantz 0e49bfda65 eina: don't init subcomponents inside eina_debug
this should be done in a single location to avoid dependency conflicts
and make the code easier to read

Differential Revision: https://phab.enlightenment.org/D6301
2018-06-19 13:55:36 -04:00
Mike Blumenkrantz 8ef0cd0950 eina: disable abort on shutdown when triggered by system monitoring thread
Summary:
this lock/thread never gets destroyed, so it should not trigger failure cases
when that is always the case

@fix

Depends on D6266

Reviewers: stefan_schmidt, ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6267
2018-06-15 15:38:33 -04:00
Marcel Hollerbach 7165003bc6 introduce eina_vpath!
Its the successor of efl.vpath, the api is synchronous, and supports
addtional vpath paths, new apis cal always be added to use them.
2018-02-22 09:26:55 +01:00
Xavi Artigas ee61190af8 Typo in error message 2018-01-02 13:56:04 +01:00
Cedric BAIL 3e73c10055 eina: add an error for when a feature is not implemented. 2017-12-11 14:35:06 -08:00
Cedric Bail 7cfb9e00ed eina: properly initialize EINA_ERROR_NOT_MAIN_LOOP. 2017-11-17 11:11:48 -08:00
Vincent Torri 9b416d2360 eina: remove EFL_HAVE_WIN32_THREADS define as it is unused since winpthread is used
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-09-26 10:17:04 -07:00
Guilherme Iscaro 5bd8c9a78d Eina: Add Eina_Promise/Eina_Future.
This commit adds a new promise/future API which aims to replace
efl_future.
2017-09-04 10:24:00 -03:00
Gustavo Sverzut Barbieri 13a8842614 eina: fix compilation warning on _WIN32 due missing strndup()
Eina.h will include Evil.h, but those using direct include of internal
headers must include it as well.
2017-03-29 12:44:19 -03:00
Marcel Hollerbach 86fe6609c2 eina: move the _eina_main_loop set before we init anything
otherwise we could get into problems.

fix T4891

@fix
2017-02-28 11:46:56 +01:00
Jean-Philippe Andre 4550b4cf83 eina: Introduce Eina_Slstr for short-lived strings
Built on top of the new 'postponed' free queue, the short-lived
strings API allows users to return new strings without caring
about freeing them. EFL main loop will do this automatically for
them you at a later point in time (at the end of an iteration).

The APIs provided will either duplicate (copy) or more generally
steal an existing string (char *, stringshare, tmpstr, strbuf),
taking ownership of it and controling its lifetime. Those strings
can then be safely returned by an API. From a user point of view,
those strings must be considered like simple const char *, ie.
no need to free() them and their validity is limited to the
local scope.

There is no function to remove such a string from the freeq.

The short lived strings API is not thread-safe: do not send a
short-lived object from one thread to another.

@feature
2017-01-17 14:20:55 +09:00
Jean-Philippe Andre 4f5e64fdea eina_freeq: Add mode for postponed deletion
While this reuses the existing (but new) infrastructure of
eina_freeq, the mode of operation and objective is very different
from the default freeq.

By default, any object added to the freeq is basically already
freed from the user point of view, and the freeq itself only adds
a tiny layer of memory safety by deferring the actual call to free
and optionally filling the memory blob with a pattern ('wwwww...').
This is mostly thread-safe (requires thread-safe free functions).

This new type I called postponed is intended to store objects that
will be short lived. This is not thread safe as the life of the
objects added to this queue depends on the thread that adds to
the queue. The main intent is to introduce a new API for short-lived
strings.

@feature
2017-01-17 14:05:16 +09:00
Bruno Dilly adb95630ef eina: remove tests, examples and docs for eina_model
Summary:
Since eina_model was dropped some years ago.
Also a few other points where related stuff is just commented out.

Reviewers: iscaro, barbieri

Reviewed By: barbieri

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4442
2016-11-30 18:37:34 -02:00
Cedric BAIL de131bf5d0 eina: remove Eina_Promise. 2016-11-07 13:43:11 -08:00
Carsten Haitzler 0ee33e7b4b eina - add a free queue (eina_freeq) for deferring frees of data
this adds eina_freeq api's for c land for deferring freeing of
pointers and can be used a s a simple copy & paste drop-in for free()
just to "do this later". the pointer will eveentually be freed as
eina_shutdown will free the main free queue and this will in turn free
everything in it. as long as the main lo0op keeps pumping things will
og on the queue and then be freed from it. free queues have limits so
if they get full they will clear out old pointers and free them so it
won't grow without bound. the default max is 1mb of data or 16384
items whichever limit is hit first and at that point the oldest item
will be freed to make room for the newest. the mainloop whenever it
finishes idle enterers will add an idler to spin and free while idle.
the sizes can be tuned and aruged about as to what defaults should be.

this also allows for better memory debugging too by being able to fill
freed memory with patterns if its small enough etc. etc.

@feature
2016-11-06 13:13:10 +09:00
Marcel Hollerbach cf643b627c eina: fix shutdown
in eina_file we are using eina_hash, eina_hash is using eina_rbtree, so
we should ensure that rbtree is shutted down AFTER file is shutted down.

fix T4753
2016-10-24 21:42:28 +02:00
Derek Foreman c98bb97ff0 Revert "eina: Actually call eina_cpu_init() and eina_cpu_shutdown()"
This reverts commit 1881b0d343.

This is called from an array constructed with pre-processor macros and
I didn't notice.
2016-09-16 19:39:38 -05:00
Derek Foreman 1881b0d343 eina: Actually call eina_cpu_init() and eina_cpu_shutdown()
Without calling eina_cpu_init() the eina_cpu_features bits aren't
properly set up.

Let's call it and see if anything exciting happens.
2016-09-16 14:10:49 -05:00
Felipe Magno de Almeida 949af55947 eina: Add support for eina_safepointer in promises 2016-06-11 10:40:27 -03:00
Cedric BAIL 692b2c9fc9 eina: add generic infrastructure for a Eina_Safepointer
This is heavily inspired from Eo_Id infrastructure. Main change
are that the lower bit are always guaranteed to be zero and ignored
by all function. Also it may be a little bit less efficient in some
case, but we will tune it once we have real life usage of it.

Eo won't be migrated for 1.18 to it as Eo_Id is deeply integrated
and it is quite risky to touch it so close from a freeze. This can
wait.
2016-06-10 13:57:01 -07:00
Felipe Magno de Almeida 6d43adaaf4 eina: Fix memory leaks in promise 2016-05-07 13:55:18 -03:00
Felipe Magno de Almeida 236c13df34 eina: Add progress notify callback feature for Promise Owners
Add a way for users of the promise owner to get notified when a
promise progress is registered. Also added a convenience composition
function that creates a promise which is fulfilled when another
promise has a progress notification.
2016-05-06 12:41:42 -03:00
Cedric Bail b4456121be eina: implement a memory cache for Eina_Rbtree_Iterator.
So it seems we are using Eina_Hash_Iterator quite a lot more than before.
This lead to a huge amount of alloc/free of Eina_Rbtree_Iterator that
was noticable in Enlightenment callgrind trace. This patch make it vanish
from the trace :-)
2016-04-22 10:58:25 -07:00
Jean-Philippe Andre d99ca361de Eina: Micro-optimize eina_main_loop_is
This is useful when Eo calls it to get the current frame stack.
This improves the performance of this function by ~50% which meant
from ~3% total CPU time to ~1.5% CPU time (if called at each eo_do).

Now this patch is a bit irrelevant since eo uses __thread instead.

This optimization is still useful for evas_eglGetCurrentXXX.
2015-11-10 16:12:21 +09:00
Carsten Haitzler 2aeb289063 eina - begin event log infra we can get from the new debug monitor
we can down dump event logs. some ecore mainloop bits are logging at
the moment.
2015-05-10 19:05:54 +09:00
Carsten Haitzler 664708b817 eina - start a much improved eina dbug infra and have eina_log use it
this makes eina_log give bt's for all error logs. this is very useful
in finding just where a problem happens. the problem int he past is
that these have not been too useful due to backtrace_symbols() being
"useless". thus use the eina_btlog tool i added too.

also started infra for a debug monitor that can use the backtrace
infra to collect runtime stats ANY TIME for a process (don't need to
run under a debugger).

@feat
2015-05-08 14:13:17 +09:00
Carsten Haitzler 009ec26460 eina + ecore - fix main loop thread id tracking on fork
if you fork and even if you do ecore_fork_reset() a thread calling
ecore_main_loop_thread_safe_call_async(0 for example eill end up
resetting the mainloop thread id to itself (a non mainlopo thread) via
calling eina_main_loop_is() since pid changed. there is little point
in doing this so remove the pid tracking from eina and ensure mainloop
thread id is updated in ecore's fork reset.

@fix
2015-02-26 19:47:51 +09:00
Adrien Nader 9d1504dba1 eina: remove Eina_Counter and use provided Windows posix compatible implementation. 2015-02-11 16:38:15 +01:00
Adrien Nader 2cb0c1cadc eina: remove Windows specific thread implementation and rely on posix compliant library instead. 2015-02-11 16:38:10 +01:00
Carsten Haitzler 3c130836ad new eina api/object - eina thread queues
@feature

This is a new feature for eina (and EFL) - a zero-copy thread message
queue for sending messages from one thread to another or from the
ecore mainloop to or back to the mainloop from threads. It has a
complete test suite too.
2014-07-15 20:39:13 +09:00
Vincent Torri 9631585f24 efl: remove Windows CE support 2014-07-13 15:17:17 +02:00
Carsten Haitzler 69e27abdc3 eina - and e3fl in general - stop using eina_error_get/set - useless really 2013-10-11 16:50:40 +09:00
Cedric Bail ff3d2a68d5 eina: add infrastructure to handle more CPU and compiler builtin information. 2013-10-02 20:54:50 +09:00
Cedric BAIL 1d5692baa6 eina: add eina_log_timing. 2013-03-27 21:43:45 +09:00
Cedric BAIL ed58d0dd05 efl/eina: let's do all include.
SVN revision: 83833
2013-02-12 01:42:47 +00:00
Cedric BAIL 01dba3fbc0 efl/eina: prevent denial of service on eina_hash.
Thanks goes to Thiago Macieira for sharing the issue. This
is the result of the cross-desktop talk at fosdem. A lot more
comming in the futur !


SVN revision: 83578
2013-02-04 07:52:56 +00:00
Lucas De Marchi db395ef7eb efl: Remove check for unistd.h
* unistd.h: is very useful, very old and very standard.



SVN revision: 82577
2013-01-10 20:25:26 +00:00
Cedric BAIL 0e50f122e5 efl: Add eina copy on write infrastructure.
SVN revision: 82396
2013-01-08 09:17:56 +00:00
Cedric BAIL 903bbfba82 efl: add Eina_Thread API.
SVN revision: 78225
2012-10-19 05:47:33 +00:00
Carsten Haitzler afdd3f4a39 add tmpstr to efl eina tree... this is for the future so not going
into eina tree.



SVN revision: 78112
2012-10-17 10:24:03 +00:00
Vincent Torri 785f2a6b3a merge : add eina
currently, examples, tests and benchmark are not set. That's the next things i'll do


SVN revision: 76710
2012-09-16 10:57:48 +00:00