Commit Graph

1327 Commits

Author SHA1 Message Date
Mike Blumenkrantz 1c52aede2b eina_lock: do not set PTHREAD_MUTEX_ERRORCHECK on recursive locks
Summary:
a mutex can only have one type, so setting this type onto a recursive mutex
will unset the recursive attribute and cause deadlocks

ref T1984
@fix

Reviewers: stefan_schmidt, ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T1984

Differential Revision: https://phab.enlightenment.org/D6264
2018-06-15 11:21:43 -04:00
Xavi Artigas bd5174b600 eina: Turn stringshare printfs into EINA_LOG_DBG
Summary:
eina_share_common contained extremely verbose printfs which rendered
the debug profile (./configure --with-profile=debug) almost unusable.
They have been turned into EINA_LOG_DBG in the eina_stringshare log domain
(when related to stringshares) and without domain when related to other
eina_share facilities.

Also, cleaned up some printfs which have been commented out for 8 years.

Fixes T7006

Test Plan:
The printfs are regular eina logs and can be filtered out by regular means.
The debug profile output is far more usable now.

Reviewers: zmike, devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7006

Differential Revision: https://phab.enlightenment.org/D6288
2018-06-14 11:30:07 -04:00
Mike Blumenkrantz 92a229f6eb eina_barrier: handle PTHREAD_BARRIER_SERIAL_THREAD return from barrier_wait
Summary:
this is a valid return code which indicates success and is passed randomly to
one of the callers

@fix
Depends on D6267

Reviewers: stefan_schmidt, ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6268
2018-06-13 10:09:44 -04:00
Bryce Harrington 6ba44f9006 eina: Improve eina_array function documentation
Summary:
Define return values when errors occur.  Eliminate use of the term
'vector' to avoid confusion with eina_vector.  Cleanup grammar
throughout.

Reviewers: cedric, Hermet

Reviewed By: Hermet

Subscribers: #committers, zmike

Tags: #efl

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-05-25 10:19:22 -07:00
Cedric BAIL 842b2ec381 eina: make it possible to return an EINA_VALUE_EMPTY by just requesting a new value of type NULL. 2018-05-24 16:02:19 -07:00
Cedric BAIL 671fc92f08 eina: check the type before looking at anything else to avoid triggering valgrind warning. 2018-05-24 16:02:19 -07:00
Cedric BAIL 9dce56687b eina: path get actually allocate memory and can't be pure. 2018-05-23 21:33:04 -07:00
Cedric BAIL b8cf656bd3 eina: actually it make more sense to do the check for EINA_VALUE_EMPTY inside eina_value_type_get. 2018-05-07 09:46:42 -07:00
Cedric BAIL 2b489d5627 eina: allow EINA_VALUE_EMPTY for Eina_Future as Eina_Value. 2018-05-07 09:34:04 -07:00
Cedric BAIL 90c2e05788 eina: Eina_Future as Eina_Value can also be cancelled. 2018-05-05 21:04:20 -07:00
Bryce Harrington 16fd04cc94 eina: Revise documentation for eina_hash_foreach
Summary: Reword description to clarify what it does.

Reviewers: cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6022
2018-05-02 19:46:00 -04:00
Bryce Harrington 43aac2f7de eina: Clarify bezier documentation
Summary:
Adds documentation about internals of a couple functions and cleans up
some stray doxygen tags.

Reviewers: cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6039
2018-05-02 19:45:35 -04:00
Bryce Harrington ea52774fbd eina: Improve documentation for Eina Matrix functions
Summary:
Adds documentation for several routines, fixes some incorrect
documentation, cleans up grammar throughout, corrects a few remaining
spelling errors.

Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D6021
2018-05-02 19:44:56 -04:00
Bryce Harrington cefd8018a5 eina: Move include file to top
Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D6038
2018-05-02 19:44:25 -04:00
Cedric BAIL b1883c7989 eina: make eina_value_pget on an EINA_VALUE_TYPE_STRINGSHARE return a new reference to a stringshare. 2018-05-01 10:39:01 -07:00
Cedric Bail 473ed10c02 eina: add an EINA_VALUE_TYPE_BOOL. 2018-05-01 10:39:01 -07:00
Cedric Bail c0bcd32591 eina: allow EINA_VALUE_EMPTY to be propagated with eina_future_as_value. 2018-05-01 10:39:01 -07:00
Cedric BAIL 5bfdc435c7 eina: improve EINA_VALUE_ARRAY_FOREACH to not systematically require &. 2018-05-01 10:39:01 -07:00
Cedric BAIL be9b50cf80 eina: make the function created by EINA_VALUE_STRUCT_DESC_DEFINE inline to avoid unused warning. 2018-04-30 14:21:12 -07:00
Xavi Artigas bf8ce8ff7a eina: Provide actual len (after possible truncation) to eina_stringshare_add_length
Summary:
vsnprintf() returns "The number of characters that would have been written if n had been sufficiently large",
so if this is larger than the requested length, we pass the requested length to eina_stringshare_add_length,
to avoid reading uninitialised memory.

Fix T6903

Reviewers: zmike

Subscribers: cedric

Maniphest Tasks: T6903

Differential Revision: https://phab.enlightenment.org/D6011
2018-04-27 13:43:12 -04:00
Mike Blumenkrantz e0f8e65d20 eina: provide full string length to vsnprintf to allow for null character
Summary: fix T6903

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric

Maniphest Tasks: T6903

Differential Revision: https://phab.enlightenment.org/D6009
2018-04-26 12:24:16 -04:00
Bryce Harrington 4ea4a20455 eina: Improve documentation formatting
Summary:
Revise wording of a few parameters, improve consistency of punctuation
and documentation body placement.

Subscribers: cedric

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-04-16 11:21:50 -07:00
Bryce Harrington 025b54ce52 eina: Cleanup documentation for Sparse Matrix.
Summary:
Revises some descriptions, polishes wording, makes punctuation and
formatting more consistent, and straightens out some convoluted grammar
here and there.

There are a few places where the parameter documentation was incorrectly
cut-and-pasted from other routines, so this is fixed.  Also, in
eina_matrixsparse_iterator_new() the docs say the elements are not
returned sequentially, but from the context and code I think it meant to
say they're not _consecutive_.

Subscribers: cedric

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-04-16 11:20:24 -07:00
Cedric BAIL 621f34d322 eina: mark thread by default as not cancellable as per Eina documentation.
By default all Pthread are cancellable. This leads to strange behavior that
happen during shutdown and hasn't been figured out. Most likely fix for T6622.
2018-04-05 10:39:30 -07:00
Bryce Harrington 8267124023 eina: Cleanup grammar for eina_hash add and free routines
Summary:
This copyedits the descriptions for several _add and _free APIs.
Phrasing is made a bit more concise, without losing the meaning, and
made more consistent so the distinctive differences between the routines
are easier to spot.  Some paragraph spacing is added for clarity, for
similar reasons.

Subscribers: cedric

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-26 16:06:40 -07:00
Bryce Harrington 58df1ba17e eina: Fix typos
Subscribers: cedric

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-26 16:05:46 -07:00
Bryce Harrington 6ccc7448e7 eina: Add Doxygen in/out indicators to matrixsparse, clist, and array
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-26 16:03:46 -07:00
Cedric BAIL 07e5064e15 eina: fix promise scheduler lookup to find it when given a resolved chain of future.
T6738
2018-03-12 11:59:33 -07:00
Cedric BAIL da798e4528 eina: avoid warning when accessing first item and just return an error. 2018-03-12 11:59:13 -07:00
Bryce Harrington c96f3d5ba5 eina: tighten grammar in eina_hash API docs.
Summary:
Improve the verbage in the doxygen comments.  Refer to the value being
changed as the 'previous' rather than the 'old' value, to be more
precise.  Drop the phrase 'keeping API sane' as it is unnecessary and
is an odd thing to say.  Try to avoid referring to 'your program' as we
shouldn't assume the reader's situation.

Reviewers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-03-06 19:05:57 -08:00
Bryce Harrington 3b508dfc19 eina: define the in/out params for eina_bezier
Reviewers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-03-06 19:05:57 -08:00
Bryce Harrington 75a2dbf0d3 eina: use better parameter name in eina_rectangle
Summary:
'thiz' is not commonly used in EFL, more commonly used is a word or
abbreviation that is descriptive of the object being used ('hash' for
Eina_Hashes, 'str' for Eina_Strings, 'array' for Eina_Arrays, etc.)
Follow this convention by using 'rect' (as used already in various
places) instead of 'thiz' or 'r'.

Reviewers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-03-06 19:05:57 -08:00
Bryce Harrington e849e64fb9 eina: specify error returns in @return for eina_list API docs
Summary:
For all routines that can return NULL on error, mention this in the
function's @return docs.  In cases where a small number of situations
result in this return, move the docs to the @return; in other cases just
state the NULL return briefly and leave the elaboration in the body.

Reviewers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-03-06 19:05:57 -08:00
Carsten Haitzler 1bdd9e4dd1 ecore - a different take on efl.app class as a super class to efl.loop
so the MAIN loop is actually an efl.app object. which inherits from
efl.loop. the idea is that other loops in threads will not be efl.app
objects. thread on the creator side return an efl.thread object.
inside the thread, like the mainloop, there is now an efl.appthread
object that is for all non-main-loop threads.

every thread (main loop or child) when it spawns a thread is the
parent. there are i/o pipes from parnet to child and back. so parents
are generally expected to, if they want to talk to child thread, so
use the efl.io interfaces on efl.thread, and the main loop's elf.app
class allows you to talk to stdio back to the parent process like the
efl.appthread does the same using the efl.io interfaces to talk to its
parent app or appthread. it's symmetrical

no tests here - sure. i have been holding off on tests until things
settle. that's why i haven't done them yet. those will come back in a
subsequent commit

for really quick examples on using this see:

https://phab.enlightenment.org/F2983118
https://phab.enlightenment.org/F2983142

they are just my test code for this.

Please see this design document:

https://phab.enlightenment.org/w/efl-loops-threads/
2018-03-03 13:40:33 +09:00
subhransu mohanty 2bad5fffce eina/bezier: use FLT_EQ marcro for float equal comparison.
Reviewers: SanghyeonLee, jpeg, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5828
2018-02-28 15:15:20 +09:00
Marcel Hollerbach ae51034b85 eina_vpath: include the config header
so the function detection macros are defined.
2018-02-26 12:21:56 +01:00
Carsten Haitzler f44ccfe1d5 eina - windows home get - donyt have static buffer and do it like unix 2018-02-25 19:29:50 +09:00
Carsten Haitzler 411e140eaf eina vpath - improve docs and add app.tmp and usr.tmp vpaths too
definitely kaes the docs better with lots of sample paths and some
indication of what these may map to in real life.
2018-02-23 16:26:30 +09:00
Cedric Bail d57b9a7d14 eina: make eina_vpath_interface_app_set an internal function.
I am wondering if this one shouldn't even be a private one and
directly used by eina_prefix.
2018-02-22 15:26:28 -08:00
Cedric Bail b575c41676 eina: make eina_vpath_interface_user_set an internal API. 2018-02-22 14:57:36 -08:00
Marcel Hollerbach c4f33c67a8 move from efl.vpath to eina_vpath
The usages from efl.vpath are moved to to eina_vpath
2018-02-22 09:26:55 +01: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
Bryce Harrington 274730fc5f eina: improve documentation for eina_bezier.
Summary:
Adds missing @param docs and fixes an incorrectly documented one.
Clarifies difference between 'length' and 'position', specifying the
latter is a number between 0.0 and 1.0.  Improves verbage here and there
for grammatical correctness and internal consistency.

Subscribers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-02-14 12:47:40 -08:00
Bryce Harrington ba64b372d3 eina: make doxygen @notes consistent in eina_hash
Summary:
These routines all have slight permutations of the same basic note, but
are each formatted a bit differently.  Fix that and a few punctuation
irregularities.

Similarly for a couple @warnings, and escalate one @note to a @warning
since what it describes might be a security issue so deserves
highlighting.

Subscribers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-02-14 12:47:40 -08:00
Bryce Harrington d58ae6b12f eina: fix minor spelling mistake in eina-private.h doxygen
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-02-14 12:47:40 -08:00
Bryce Harrington 572ffe7271 eina: use matrix compose in place of equivalent code in matrix multiply
Summary:
The eina_matrix3_compose and eina_matrix3_multiply API's are
mathematically identical (even though the implementations are
reversed... weird), except that the latter also includes a fastpath for
identity matrices.

Having two functionally equivalent APIs is redundant, so ideally one or
the other would be dropped.  But in order avoid API breakage, just have
one routine wrapper the other and eliminate the internal redundancy.

(Note that the parameter signatures of the two routines are different -
eina_matrix3_compose() takes the two input matrices first, and the
output matrix last, while eina_matrix3_multiply() takes the parameters
in the reverse order.  This inconsistency in the API style could result
in accidentally erroneous usage and would be an argument for deprecation
of one of the two APIs.)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: cedric

Reviewed By: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-02-14 12:47:40 -08:00
Bryce Harrington cf2ce1c675 eina: cleanup doxygen for eina_rectangle.
Summary:
Some spelling/punctuation/grammar/formatting fixes to make the
rectangles doxygen more consistent.  Simplify wording in several places,
including removing redundant documentation of return values.  Reword the
rectangle cutting API's to be more clearly worded.  Make clearer mention
of parameters that get changed by the function call, and ones that
allocate memory.

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-02-14 12:47:40 -08:00
Carsten Haitzler 43ac3c0b4c eina - tiler -= return true if rect alreadt there as its not a failure
docs say return true on succesas, false on failure. adding a rect we
already added is not a failur. it's an optimization to a NOP. so fix.
this was brought up by and fixes T6669 ... but in the opposite way.
2018-02-11 15:55:13 +09:00
Shinwoo Kim bb5f4aa857 eina_tiler: fix typo of rect comparing 2018-02-05 20:02:06 +09:00
Vincent Torri 78af66ffb4 Eina: ignore EINA_FILE_LNK on Windows 2018-01-30 16:52:24 +09:00
Bryce Harrington 7f43866707 eina: Cleanup grammar in eina_hash doxygen
Summary:
Corrects some grammatical errors, and rephrases wording of some passages
for better clarity.  Also fix a few doxygen formatting inconsistencies.

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5764
2018-01-30 14:42:35 +09:00
Derek Foreman 3e230693e6 eina_module: Drop ridiculous ERR messages from module_list_load/unload
The documentation for these functions claims that passing a NULL array
results in doing nothing - that should also include logging nothing.

EINA_SAFETY_ON_NULL_RETURN() logs an ERR message and should be reserved
for usage when NULL is not actually a valid state.

Additionally, it's entirely possible to turn off EINA_SAFETY_CHECKS, at
which point these functions would stop behaving as the documentation
says they do.  Not great.
2018-01-26 15:54:00 -06:00
Bryce Harrington 692136202f eina: Make return doxygen consistent
Summary:
Ensure @return defines error returns consistently.  In several cases the
errors were explained in the body but not mentioned in the @return docs.

Drop redundant return value documentation for clarity.  Some routines
were defining the return values both in @return and in the doxygen body.

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5756
2018-01-24 11:35:01 +09:00
Bryce Harrington 77dc9ab874 eina: Clarify that Eina_Matrix_Type can describe any matrix
Summary:
The Eina_Matrix_Type enum is returned by eina_matrix4_type_get and
eina_matrix2_type_get; it is not Matrix3-specific.  Update doxygen
accordingly.

Reviewers: devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5744
2018-01-18 08:19:08 -05:00
Bryce Harrington 5f59a76587 eina: Cleanup spelling/grammar/punctuation for Eina List
Summary:
This fixes some typos and misspellings, massages grammar in a few
places, tidys up a little whitespace, and fixes incorrect docs in a spot
or two.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5745
2018-01-18 08:16:52 -05:00
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
Cedric BAIL 1af649d57b eina: make updating rectangle cache thread safe. 2018-01-16 09:54:04 -08:00
Jean Guyomarc'h 34d9f20706 eina: remove usless newline
Summary:
ecore_evas: remove debug

eina: unregister log level when done with

Fixes a constant memory leak.

eina: introduce EINA_HOT and EINA_COLD

These attributes respectivelly expand to __attribute__ ((hot)) and
__attribute__ ((cold)) when available. They allow to mark functions are
being hot/cold (frequently used or not) as well as to qualify labels
within a function (likely/unlikely branches).

eo: speed-up generated calls by removing call cache

The call cache needed to by thread-local, to avoid concurrency issues.
Problem with TLS is that is adds an extra overhead, which appears to be
greater than the optimization the cache provides.

Op is naturally atomic, because it is an unsigned integer. As such, it
cannot be tempered with while another thread is reading it. When
entering the generated function, the first operation done is reading
'op'. If we have concurrency, we will have access sequences returning
either EFL_NOOP or a VALID op, because 'op' is not set until the very
end of the function, when everything has been computed. As such, we now
use the 'op' atomic integer to instore a lock-free/wait-free mechanism,
which allows to drop the TLS nature of the cache, speeding up the access
to the cache, and therefore making functions execute faster.

We don't test anymore the generation count. This can be put as a
limitation. If means that if you call efl_object_shutdown() and
re-initialize it later with different data, opcodes will be invalid.
I am not sure there is any usecase for this to ever happen.
We could move all the caches in a dedicated section, that can be
overwritten after a call to efl_object_shutdown(), but I am not sure it
will be very portable.

Benchmark: mean over 3 executions of
   ELM_TEST_AUTOBOUNCE=100 time elementary_test -to genlist

```
                     BEFORE               AFTER
------------------------------------------------------------
time (ns)            11114111647.0        9147676220.0
frames               2872.3333333333335   2904.6666666666665
time per frame (ns)  3869364.6666666665   3149535.3333333335
user time (s)        11.096666666666666   9.22
cpu (%)              22.666666666666668   18.333333333333332
```

Ref T6580

Reviewers: raster, cedric

Subscribers: cedric, jpeg

Maniphest Tasks: T6580

Differential Revision: https://phab.enlightenment.org/D5738
2018-01-16 17:50:46 +09:00
Bryce Harrington ebdfc54def eina: document quadtree
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2018-01-12 11:25:04 -08:00
Vincent Torri 4916973a60 efl: remove inclusion of dirent.h where it is not used
Test Plan: compilation

Reviewers: cedric

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2018-01-12 11:06:12 -08:00
Carsten Haitzler f32f0d89f4 mmap memory allocation - do not used when under valgrind
we can't sensibly use things like massif to track memory if we bypass
itr with mmaping -1 fd anonymous memory... so if built with valgrind
support and running under valgrind, use malloc/calloc and free so
these tools actually do something useful for these bits of memory.
2018-01-12 03:02:43 +09:00
Cedric Bail 79d7483fe7 eina: add eina_promise_continue_new to create a promise using an existing dead future. 2018-01-10 18:16:25 -08:00
Carsten Haitzler 2fb80270ba efl thread signal masks - fix up for various threads manually created
so xine module plus 2 eina dbug threads didnt set up signal
blocking/masks correctly. xine use ssigprocmask not pthread_sigmask
and the other 2 didnt even bother at all. fix this so these threads
all block most of these commnly caught signals so these threads never
get them
2018-01-06 18:20:23 +09:00
Vincent Torri 4ae6eeb2cf efl: remove _MSC_VER (Visual Studio macro) usage in source code 2018-01-04 12:59:47 -08:00
Andy Williams 8e23f6abff Merge branch 'devs/xartigas/typos' 2018-01-03 09:21:33 +00:00
Carsten Haitzler 0ccf813112 eina debug - use pthread _sigmask instead of sigprocmask like elsewhere
elsewhere in efl we moved to pthread_sigmask but eina debug didn't, so
mirror the changes here too. at this point in time when we are
initting eina debug this shouldnt really matter much as we're single
threaded until this pthread_Create is called. after that tough...
we're not. signals + threads is a nightmare though... horrible
horrible...
2018-01-03 13:05:16 +09:00
Xavi Artigas ee61190af8 Typo in error message 2018-01-02 13:56:04 +01:00
Xavi Artigas e4e48aa4f9 Typo in example 2018-01-02 13:56:04 +01:00
Carsten Haitzler b27ca559f6 remove elgacy ecore event usage in futures that limit to mainloop only
also eina_procmis was not threadsafe so cannto use loops in different
threads at all until this was made safe. needed to disable the old
ecore_event using code in for ecore futures and create a new efl loop
message future and handler instead ... but now a quick experiment with
multiple loops in 10 threads plus mainloop have timers at least work.
i need to test more like fd handlers etc etc. but it's a step.
2017-12-28 02:24:12 +09:00
Andy Williams 9a4eedb078 Remove all ocurrences of SPANK from our user facing errors.
This has been bugging me for some time but now we are triggering new errors internally
this is appearing to end users for problems they did not cause.

Additionally I was able to improve a couple of the errors by copying the
explanation from code comments into the error message.

Shorter error logs now too :)
2017-12-22 11:18:46 +00:00
Carsten Haitzler 9c88bc4933 elm build for osx - try another dotting of i's and crossing of t's
try this and fix T6448 ...
2017-12-20 19:07:01 +09:00
Cedric BAIL 98aa1a4eb1 eina: fixup EAPI definition. 2017-12-19 09:54:45 -08:00
Jean Guyomarc'h e835a02ebb eina: fix random segfaults when displaying BT
Under some circumstances, eina crashes when attempting to display the
backtrace, because dladdr() may yield a dli_fname that is NULL. This is
especially annoying in realease, when the backtrace is shown by default
when CRI/ERR are thrown.

@fix
2017-12-19 16:56:22 +01:00
Jean-Philippe Andre 29ce7550eb eina: Add missing eina_internal.h 2017-12-19 10:20:18 +09:00
Cedric BAIL 90f30ea418 eina: make __eina_promise_cancel_all an internal only function. 2017-12-18 16:17:04 -08:00
Jean-Philippe Andre 5dbfb7961f eo/eina: Add HACK to avoid calls to EO after shutdown
Efl.Future is an EO object which means even cancelling Efl.Future
objects requires EO. So this should be done before shutting down EO,
otherwise everything fails badly.

I believe Efl.Future is going to disappear soon, but the problem will
remain: if any promise/future uses EO or anything else outside of Eina
(so, basically anything) then it needs to be canceled before shutting
down the above layers. This is the same situation as with ecore events,
for which we've introduced ecore_event_type_flush.

Ping @cedric
2017-12-18 19:54:31 +09:00
Ross Vandegrift 71e5c74eb6 efl: drop deprecated Encoding key from desktop files
Summary:
The Encoding key is no longer required, all desktop files are assumed to
be UTF-8 encoded.  See details at:
https://standards.freedesktop.org/desktop-entry-spec/1.1/apc.html

Fix various typos and misspellings

lintian, Debian's package checker, uses strings to check for common typos
in compiled binaries.  This change fixes the ones it identified in 1.20.6.

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-12-13 10:27:48 -08:00
Cedric BAIL 3e73c10055 eina: add an error for when a feature is not implemented. 2017-12-11 14:35:06 -08:00
Chris Michael b3c29fd25c eina: Fix typo in doxygen
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-12-11 14:51:55 -05:00
Vincent Torri 771bb6e6a7 Evil: use static buffer to store error messages
Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5394
2017-12-11 16:04:02 +09:00
Andy Williams 9d09d722b9 eina: Update header for readability
Author Nate Drake
Reviewer: Andy Williams
2017-12-07 16:21:11 +00:00
Al Poole 1be1ef168a eina_file_win32: also check for copy before unmapping region. 2017-12-02 11:45:53 +00:00
Al Poole a538f47854 eina_file: make sure we use a stringshare when virtualized.
As the filename is now a stringshare, also make sure virtual
files use stringshares for the filename! Also when unmapping
we still need to test whether it is copied or not as unmap
will break on less tolerant architectures.

@fix T6449
2017-11-30 13:57:25 +00:00
Carsten Haitzler e0f4455eaa eina safepointer - mimic 47 bit eoid patch
same thing as b209b9a92286209281c12e81fd9dd72dc28c7495 but for safeptr
2017-11-24 18:29:23 +09:00
Pawel Aksiutowicz c7bedc2b23 eina: warning removed from eina_debug_timer
Reviewers: stanluk, lukasz.stanislawski

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5500
2017-11-21 11:17:51 +09:00
Bryce Harrington 98fd820648 eina: Fix matrix header guard name
Summary:
eina_matrix.h includes matrix2, matrix3, and matrix4, so the header
guards shouldn't specify MATRIX3.

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5508
2017-11-21 11:00:53 +09:00
Bryce Harrington cc14a1288c eina: Indicate in and out parameters for eina_matrix
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5496
2017-11-20 12:02:24 +09:00
Cedric Bail 7821367b1a eina: properly initialize EINA_ERROR_VALUE_FAILED. 2017-11-17 11:12:06 -08:00
Cedric Bail 7cfb9e00ed eina: properly initialize EINA_ERROR_NOT_MAIN_LOOP. 2017-11-17 11:11:48 -08:00
Cedric Bail 574d4526cb eina: properly initialize EINA_ERROR_MAGIC_FAILED. 2017-11-17 11:11:28 -08:00
Cedric Bail 8fbd8bfe2a eina: fail with an Eina_Error on copy failure. 2017-11-17 10:44:26 -08:00
Andy Williams 63c6724f08 eina: fix docs for manage_read_only_new 2017-11-16 12:49:56 +00:00
Bryce Harrington 1227f914e2 eina: Improve API docs for eina_crc.h
Reviewers: cedric, ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: jpeg, segfaultxavi

Differential Revision: https://phab.enlightenment.org/D5468
2017-11-14 13:14:59 +00:00
Bryce Harrington 7764abe8f6 eina: Fix spelling/punctuation errors in docs (quaternion..rectangle)
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5450
2017-11-13 12:09:21 +09:00
Bryce Harrington b60c3fb3ba eina: Fix spelling/punctuation errors in documentation (safepointer..strbuf)
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5458
2017-11-13 12:05:09 +09:00
Bryce Harrington dab3a6fca3 eina: Fix spelling/punctuation errors in documentation (thread..xattr)
Summary:
Also makes some of the doxygen comment line spacing/formatting
consistent.

Interesting ref on grammar of 'an uniform' vs. 'a uniform':
  https://english.stackexchange.com/questions/4700/is-it-a-uniform-or-an-uniform
It is AN honor to work with such A uniform language as English. *sigh*

Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5459
2017-11-13 12:04:59 +09:00
Bryce Harrington d0ded365e9 eina: Add API doxygen for eina_rbtree_inline_lookup()
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5460
2017-11-13 12:04:39 +09:00
Bryce Harrington 3830cbaa25 eina: Improve eina_alloca API dox
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5461
2017-11-13 12:04:32 +09:00
Bryce Harrington 50fba34e6c eina: Fix spelling/punctuation errors in documentation (prefix..promise)
Reviewers: cedric, ajwillia.ms

Subscribers: jpeg, segfaultxavi

Differential Revision: https://phab.enlightenment.org/D5438
2017-11-08 15:20:34 +09:00
Bryce Harrington 70f7f88eab eina: Fix spelling errors in documentation (matrixsparse..module)
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5425
2017-11-07 09:03:57 +00:00
Carsten Haitzler 3790c4d47a eina freeq - make it clear that content is invalid on submission
and that the free function cannot access content of the pointer
(unless the pointer memory size is 0).
2017-11-07 17:36:57 +09:00
Cedric BAIL e891a01749 eina: add a function return a reference to a copy of Eina_Value. 2017-11-03 15:31:30 -07:00
Andy Williams 82b0da0c8a Correct struct labelling
Avoids linking every occurrence of 'The'
2017-11-02 20:57:47 +00:00
Bryce Harrington 054e817572 eina: Fix spelling errors in documentation (log..matrix)
Reviewers: cedric, ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5417
2017-11-01 11:36:50 +09:00
Bryce Harrington 57d0617fec eina: Fix spelling errors in documentation (file..lock)
Summary: Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: cedric, ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: segfaultxavi, jpeg

Differential Revision: https://phab.enlightenment.org/D5410
2017-10-31 11:31:41 +00:00
Amitesh Singh 3505b7618c eina: eina_value: fix the typo in doc 2017-10-30 16:11:57 +09:00
Amitesh Singh 04fe5e10a2 eina: eina_value - Add "struct tm" support
Ref T6204

@feature
2017-10-30 16:04:53 +09:00
Jean Guyomarc'h 87c2b37d8d eina: enforce strict Eina_Bool parameter 2017-10-29 13:59:17 +01:00
Carsten Haitzler 31f8c6f17e eina debug - ensure sockaddr is 0'd out before filling in to avoid junk
valgrind does complain about this. i'm not sure it matters but it's
safer to 0 it out in case some field is being used that we don't think
is being used that we didn't set.
2017-10-29 11:19:48 +09:00
Bryce Harrington 6ac4497162 eina: fix spelling errors in documentation
Reviewers: cedric, ajwillia.ms

Reviewed By: cedric

Subscribers: segfaultxavi, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-27 12:12:25 -07:00
JinYong Park b550581dde eina: add param, return type description for eina_unicode.
Summary: Add missing parameters and return type description to remove doxygen warning

Test Plan: API Doxygen Revision

Reviewers: cedric, jpeg, myoungwoon, Jaehyun_Cho, id213sin

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-27 12:12:25 -07:00
Jaehyun Cho ccbe98ccb2 eina_ustringshare: Add description of return to resolve doxygen warning
Change-Id: I1994dbb3bf628c67c43763c8521fcfe7c5179308
2017-10-26 13:20:54 +09:00
Jaehyun Cho 2a133ff290 eina_stringshare: Fix doxygen warning
Change-Id: Id2f9e8b16d7e1dd581b71df6842f1b467e535634
2017-10-26 13:20:54 +09:00
Jaehyun Cho e65e8a4fba eina_str: Fix doxygen warning
Change-Id: I4cac2b3836f8d0fb05d76b039af66b41fca0c19f
2017-10-26 13:20:54 +09:00
Jaehyun Cho 786a7ae421 eina_strbuf: Fix doxygen warning
Change-Id: I82b15f1352f6a7925d7cde0dfb91c3d835a35dd7
2017-10-26 13:20:54 +09:00
Jaehyun Cho cb3eb09451 eina_module: Add description of parameter to resolve doxygen warning
Change-Id: I545b68e86976d4e2479fbf87ff5a8b38b9905c13
2017-10-26 13:20:54 +09:00
Cedric BAIL e474edc9f6 eina: add helper to return already known to fail future. 2017-10-25 13:39:44 -07:00
Jaehyun Cho 6c8ca79ff2 eina_matrix: Fix doxygen warnings
Change-Id: I7e697bae24170422d6253f91ce089d9485bd0e64
2017-10-25 21:59:55 +09:00
JinYong Park 61f4a5e033 eina_log: add parameter description on "eina_log_level_check"'s annotation
Summary:
In eina_log_level_check's annotation, parameter description is missing,
so warning is occurred on doxygen

Test Plan: API Doxygen Revision

Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5375
2017-10-25 19:11:19 +09:00
JinYong Park a205d9f60a eina_file: fix space location in annotation
Summary: Space character is located in wrong position, so it occur doxygen warning

Test Plan: API Doxygen Revision

Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5374
2017-10-25 19:11:15 +09:00
Andy Williams 8e25467a65 Fix building on windows
@author vtorri
2017-10-22 20:21:12 +01:00
Cedric BAIL b410417d68 eina: silence warning. 2017-10-19 16:34:25 -07:00
Cedric BAIL 4c44067d0b eina: add Evil include on Windows as strndup is provided by it. 2017-10-19 15:29:35 -07:00
Cedric BAIL 867ad5000b eina: forgotten label on eina_file_unlink on Windows. 2017-10-19 10:28:45 -07:00
Cedric BAIL 38536c9ae9 eina: downgrad ERR to WRN when not finding a file. 2017-10-19 10:26:26 -07:00
Jean-Philippe Andre a1a04629e4 benchmarks: Fix titles in gnuplot
Just replace _ with \_ as _ means subscript.
2017-10-18 11:02:16 +09:00
Cedric Bail 6e64a104a6 eina: use a stringshare to store the filename internally.
T6164
2017-10-17 16:15:19 -07:00
Cedric Bail e0807ce797 eina: fix eina_hash_stringshared_new to actually compute the hash on the pointer.
Before this patch, the key would always be zero and the hash would solely
rely on the rbtree to be efficient. This improve the situation by using the pointer
as the key during hash computation.
2017-10-17 16:15:18 -07:00
Cedric Bail 29c6c3b95b eina: refactor eina hash computation of key length and hash value. 2017-10-17 16:15:18 -07:00
Bowon Ryu a5323998c7 eina: add missing documentation for quad.
Summary: This adds missing doxgen documentation for eina_quad.

Test Plan: API Doxygen Revision

Reviewers: cedric, jpeg, myoungwoon

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-17 11:00:53 -07:00
Bowon Ryu 47f70a43d1 eina: add missing documentation for rectangle.
Summary: This adds missing doxgen documentation for eina_rectangle.

Test Plan: API Doxygen Revision

Reviewers: cedric, jpeg, myoungwoon

Reviewed By: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-17 10:56:23 -07:00
Bowon Ryu a0bcf57bef eina: fix doxygen typo for eina_thread.
Summary: fix typo.

Test Plan: API Doxygen Revision

Reviewers: cedric, jpeg, myoungwoon

Reviewed By: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-17 10:54:24 -07:00
SangHyeon Jade Lee 5798e226d5 fix typo space in include on eina_lock
remove space typo between #sharp and include about inline header
in eina_lock.h
2017-10-17 14:58:56 +09:00
Bowon Ryu 01147d084f eina: rename parameter for doxygen
Summary:
Some parameter's name are different in annotations and statements,
so it occurs doxygen warning.
To fix it, rename that parameters.

Test Plan: API Doxygen Revision

Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-10-16 13:39:33 -07:00
Prince Kumar Dubey 030a3448fb eina: fix warning if EINA_SAFETY_CHECKS is disabled
Summary:
Putting local variable "d" under preprocessor flag "EINA_SAFETY_CHECKS" to avoid below warning, if "EINA_SAFETY_CHECKS" is disabled.
        1. local variable "d" is assigned but not used.
        2. If warning 1 is resolved then variable "d" will be unused.

Reviewers: raster, cedric

Reviewed By: cedric

Subscribers: jpeg, rajeshps

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-10-16 13:36:12 -07:00
Bryce Harrington 1f6d3b40e4 eina: spellfix comment in matrix code
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 11:51:56 -07:00
Bryce Harrington 150485b5d4 eina: document matrix3 API routines.
Summary: This adds missing doxygen documentation for eight matrix3 operations.

Reviewers: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 11:47:58 -07:00
Subodh Kumar be63db00a7 eina: comparing unsigned integer with less than zero.
Summary: Unsigned integer should not be compared less than zero.

Test Plan: NA

Reviewers: cedric

Subscribers: shilpasingh, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 11:46:32 -07:00
Amitesh Singh 2cf24eb304 eina: strbuf - Add strftime related functions
eina_strbuf_append_strftime()
eina_strbuf_insert_strftime()
eina_strbuf_prepend_strftime() - macro

We need these functions for implementing generic format function
interface especially for calander.

Ref T6204
2017-10-13 16:04:24 +09:00
Subodh Kumar f418d62af3 eina: comparing less than zero with unsigned long int
Summary:
Unsigned integer should not be compared to less than zero
@fix

Test Plan: NA

Reviewers: cedric

Reviewed By: cedric

Subscribers: jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-09 16:37:50 -07:00
Cedric BAIL 674a75ca8b eina: continue to check for magic. 2017-10-05 09:28:13 -07:00
Cedric Bail 43b524eea2 eina: Eina_Prefix should never contain a NULL, no code expect it. 2017-10-04 20:57:08 -07:00
Cedric Bail 4ccc5d4f68 eina: allow eina_file_close(NULL) to simplify code using Eina_File. 2017-10-04 20:56:15 -07:00
Vincent Torri 10ba064b65 Windows: remove XP support and forbid compilation and run on this platform
Test Plan: run on XP

Reviewers: jpeg, cedric, ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D5245
2017-10-01 18:09:46 +01:00
Carsten Haitzler a37e1e479d eina debug - add missing unlock in erite err case
fix CID 1381503
2017-10-01 16:04:35 +09:00
Carsten Haitzler 05b26102cf eina debug - check write return values and complain on failure
coverity - fix CID 1377521
2017-09-29 12:26:57 +09:00
Carsten Haitzler b7d4372221 eina debug - check write return value and complain
makes coverity happy - CID 1377524
2017-09-29 12:26:57 +09:00
Cedric BAIL 3a3ae49afd eina: add an helper to setup Eina_Value structure description.
This is particularly useful on system like Windows who doesn't allow
setting pointer at compile time in static const structure.
2017-09-27 16:30:31 -07: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
Jeeyong Um c3709d2a5a docs: eina_value: fix a typo 2017-09-25 09:24:16 +09:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Bryce Harrington 224b75b46d eina: document matrix3 multiplication routines
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-09-18 11:18:43 -07:00
Jean-Philippe Andre 8fb194d969 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +09:00
Jean-Philippe Andre f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
Jean-Philippe Andre 05c051405e eina file: Ensure populate is safe to call
This makes sure that the call to madvise is safe. On Linux it's not too
much of an issue as checks are made inside madvise, and the worst that
can happen is an error is returned (EINVAL). Not great.

But if MAP_POPULATE is not present, as is the case on *BSD, then the
internal function _eina_file_map_populate() is used for the populate
rule. In that case actual data is read and we should make sure not to
trigger a segfault or bus error.

Also, this makes sure that in case of HugeTLB we actually populate all
pages, rather than one page out of 8 (we were jumping by 16Mb instead of
2Mb).

Note: Can we get the size of a HugeTLB at runtime? We're assuming 2Mb
which might very well not be the case!
See: https://wiki.debian.org/Hugepages

Tested by disabling MAP_POPULATE and observing crashes :)

@fix
2017-09-18 11:58:53 +09:00
Jean-Philippe Andre b2ea60691e eina file: Fix map_populate on the global map
If eina_file_map_all() is called, the map isn't added to the internal
hash "rmap" and so _eina_file_map_rule_apply() would never be called.

@fix

asa
2017-09-18 11:58:53 +09:00
Jean Guyomarc'h ca731fbfb6 eina: handle errors when creating a mempool
If the backend initialization failed, the mempool would still be
successfully created. The mempool is now destroyed on failure.
2017-09-16 14:28:39 +02:00
Cedric BAIL 112777fc7a eina: add iterator macro for Eina_Value that contain an array. 2017-09-14 11:00:34 -07:00
Cedric BAIL 024c6a9fc3 efl: silent warnings shown on solaris due to missing header files. 2017-09-14 09:59:02 -07:00
Cedric Bail 8fbfab83e9 eina: add an ability to quickly convert from an Eina_Value to an Eina_Binbuf. 2017-09-13 17:26:04 -07:00
Cedric Bail f5487c5d3e eina: fix Eina_Rectangle support in Eina_Value.
Thanks for the review Gustavo.
2017-09-13 10:39:31 -07:00
Cedric Bail 430095d4f1 eina: allow convertion to BLOB from Eina_File Eina_Value by mmap the file. 2017-09-13 10:38:36 -07:00
Cedric Bail af452c439d eina: improve Eina_File support in Eina_Value.
Thanks Gustavo.
2017-09-13 10:36:05 -07:00
Vincent Torri 966577ffed eina: add an Eina_Value helper for Eina_Rectangle. 2017-09-12 17:03:49 -07:00
Cedric BAIL 95dd799715 eina: add an Eina_Value helper for Eina_File. 2017-09-12 17:03:17 -07:00
Cedric BAIL 19e0f35d1c eina: cleanup documentation for promise. 2017-09-12 10:16:44 -07:00
Cedric BAIL fa9acf8b35 eina: add eina_promise_data_set symetric to eina_promise_data_get. 2017-09-11 16:09:43 -07:00
Cedric BAIL 54083a7835 eina: fix typos in eina_promise_all_array documentation. 2017-09-11 16:08:23 -07:00
Stefan Schmidt 79956eee63 eina: fix build for big endian platforms
Summary:
The code in eina_debug.c requires the eina_swapX() functions on big endian platforms, so include the required header.

Test Plan: Do build on big endian platform like ppc64 or s390x.

Subscribers: kubu, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5158
2017-09-11 14:08:41 +02:00
Thiep Ha aced128e85 eina_promise: remove shadowed declaration warning 2017-09-05 15:56:00 +09:00
Jean Guyomarc'h b5e7a00681 eina: fix destruction of the osx semaphores
Well... that's just embarassing... semaphore_destroy() actually takes
the mach task as its first parameter, not the second. This core
amazingly worked very fine on macOS earlier than Sierra.

Fixes T5245
2017-09-05 00:45:04 +02:00
Gustavo Sverzut Barbieri d258774c2a Eina_Future: add eina_future_resolved()
This is a helper that creates a promise, then a future and immediately
resolves the promise, this will let the future be dispatched as usual,
from a clean main loop context.
2017-09-04 10:24:00 -03: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
Jean-Philippe Andre f4ed430ddc eina_array: Fix magic checks to return
The EINA_MAGIC check inside eina_array were just printing the error
message, without failing. This could lead to more crashes than
necessary.

@fix
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 4a6b52465d eina: Add convenience eina_rectangle_equal
@feature
2017-08-30 17:29:52 +09:00
Carsten Haitzler a5c8e883d8 eina mmap safety - only map zeropages if it's an eina file that sigbuses
restrict mapping /dev/zero to only eina files having a sigbus
reported. the mmap was before all our file access used eina_file i
think thus the raw mmap of it. now walk all eina files and find the
candidate and only then if it exists flag is as having a faulty i/o
backing and map the zerto pages then return, otherwise call abort.
more restricted mapping and perhaps a fix for not trapping non-efl
issues.

@fix
2017-08-30 12:03:41 +09:00
Carsten Haitzler 15cdd9b71b eina file - use recursive locks for cache and file to avoid deadlock
since we have a sigbusd handler that flags an eina file with io errors
it has to walk the file cache and every file... taking locks. if those
locks were taking already in the current thread the sighandler was
called in... we'd deadlock. since this basicallly never happens (when
do we see i/o errors really? not much)... we never saw this as it'd
also reauire this race condition to happen too. but it is a problem
waiting to happen. this fixes that by moving to recrusive locks.

@fix
2017-08-30 11:31:02 +09:00
Jean Guyomarc'h 232e193673 eina: fix typo in documentation 2017-08-29 20:56:31 +02:00
Gustavo Sverzut Barbieri 71a74aa718 eina_value: silent -Wextra for EINA_VALUE_EMPTY
-Wextra complains about missing initializers, so provide the full 8
 bytes of the first member of the union.
2017-08-28 18:26:29 -03:00
Gustavo Sverzut Barbieri 9ac1cb4fad eina_value: add helper: eina_value_struct_desc_get().
this helper will validate a struct and fetch its description, also
checking if the user version matches.
2017-08-24 11:13:56 -03:00
Gustavo Sverzut Barbieri 103b134916 eina_value_util: eina_value_X_get() helpers.
These helpers will validate the type prior to get its value, also
enforcing the correct pointer is passed.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri f4b02d87d6 eina_value_util: init helpers (stack/return).
These helpers are similar to eina_value_X_new(), however do not
allocate the Eina_Value, rather return it.

These are useful when the value struct storage was already there but
needs to be initialized in a single line, like as stack variables or
when returning a value.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri c158d5c17a eina_value_util: add missing eina_value_*_new() for basic types.
make all basic types available as _new() helpers.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri 39acaab5e9 eina_value_util: remove "_util" from names.
these utilities are very useful, but names became too long. Since they
do not conflict with anything else, shorten them.

Since they were available before as inline function, provide a macro
to rename them for old source that's compiled against newer library.
2017-08-23 18:32:13 -03:00
Guilherme Iscaro 6cbfe100d5 Eina_Value type EINA_value. 2017-08-23 18:32:13 -03:00
Guilherme Iscaro 3ed176370d Eina: Add EINA_VALUE_TYPE_ERROR
This new type will be used by the new promise/future implementation,
which will be used to flag errors.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri 4da53492ae add EINA_VALUE_EMPTY, allow flushing empty values.
EINA_VALUE_EMPTY is basically a zeroed Eina_Value, handy for declaring
and returning.

To cope with the rest of efl, free/del/flush on NULL shouldn't
complain, so flusing an empty value should be quiet.
2017-08-23 18:32:13 -03:00
Gustavo Sverzut Barbieri 4cd1257b1b value size is stored in type, no need to manually specify them. 2017-08-15 19:01:23 -03:00
Cedric BAIL b5cede94ea eina: add an API to check if a pointer is a valid element of a mempool. 2017-08-15 13:46:34 -07:00
Jean-Philippe Andre b290cb5de0 eina_slstr: Fix leak in an error case
This function takes ownership of the incoming strbuf
2017-08-04 10:24:03 +09:00
Carsten Haitzler 256450d294 eina debug - remove other swap and comment on the weirdness of this 2017-08-03 09:08:04 +09:00
Cedric BAIL eed23765f9 eina: failing to load a module is actually an ERR that user should see. 2017-08-02 16:16:33 -07:00
Guilherme Iscaro 48443fda8f Eina_File: Avoid using munmap() on file->global_map.
When a virtualized file is created the file->global_map will not
point to a mmapped region, thus it's not safe to use munmap() during
the file cleanup. Only use munmap() if the file is backed by a FD.

Fixes: T5234.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-08-02 16:03:20 -07:00
Carsten Haitzler 470b48d63c eina debug - new debug infra - comment out and make a note on bad endian
bad endian... code... see the comment in the src about why i think
this is bad as obviously the buffer pointed to is a 64bit type always
that is a pointer to something...
2017-08-02 22:41:54 +09:00
Carsten Haitzler cae354d299 eina hamster count - use a fixed version, revision etc. so builds repro
this should help with repdocucable builds by having our hamsters
constant for a build of a specific code revision.

@fix
2017-08-02 17:12:28 +09:00
Carsten Haitzler 573d0cf586 eina debug - set length after freeing/iterating over the keys
found by PVS studio
2017-07-31 10:03:59 +09:00
Carsten Haitzler cfe4f19f54 eina simple xml parser - remove pointless memcmp of 0 bytes
no point - all we are doing is having a final fallback of any tag that
starts with ! that isnt a special one like !DOCTYPE, !-- comment and
![CDATA stuff... analysers dont like these pointless calls.

found by PVS studio
2017-07-29 11:03:01 +09:00
Carsten Haitzler d6785cfeb6 eina debug - if calloc for session struct failed - return NULL
makes analysers happy but really doesnt change anything - moves the
abort/crash/exit somewhere else.

found by PVS studio
2017-07-29 10:37:44 +09:00
Carsten Haitzler b944fc7c9b eina evlog debugging - when freeing debug buf with mmap 0 size after
munmap would not munmap the memory with  a size of 0... so zero the
size after the munmap.

found by PVS studio

@fix
2017-07-29 09:08:40 +09:00
Carsten Haitzler 091146fa34 eina inarray accessor - use right type in parameter
this actually wasn't a bug that would cause a crash. cloning an array
access would fail as the magic check would find its an accessor not an
array. indeed a bug... but we never used this anywhere i can find.

this was cast to the correct func ptr callabck in the accessor struct
as the clone method though.. thus everyhting was happy with it
seemingly.

found by PVS studio

@fix
2017-07-29 08:55:27 +09:00
Carsten Haitzler bb7e8456c4 eina debug timer - handle fail wakeup write with error complaint
fix CID 1377528
2017-07-23 19:26:56 +09:00
Carsten Haitzler 758e7d3562 eina debug - don't try and collect stats on more than a million threads
sanity check... just in case.
2017-07-23 19:09:11 +09:00
Carsten Haitzler 6a65cb2f3c eina debug - add comments to cpu debug using locks to pause sysmon
this is intended so leave comments saying so. coverity doesn't like it
with CID 1377549
2017-07-23 18:43:58 +09:00
Carsten Haitzler c69f9d2837 eina debug - check return value of syscall for errors
this should fix CID 1377550
2017-07-23 18:40:04 +09:00
Jean-Philippe Andre 5db3e557c5 eina_list: Ensure single init
This fixes a crash in make check when --profile=dev is explicitely
enabled. eina_list_init() is called by the standard eina_init() loop
and by eina_debug_init() as well.

Honestly I'm not sure why it doesn't crash for other people as
well...

The crash was in eolian_suite during the second eina_init (called
from eolian_init).
2017-07-20 17:47:51 +09:00
Andy Williams bf8a0eead2 OSX: fix version detection in build 2017-07-17 13:04:30 +01:00
Carsten Haitzler 9d1a8bb082 eina debug bt sig handle - fix build on osx for clockid_t
fix #ifdefs so it should in theory build on osx 10.11.x

@fix
2017-07-17 16:04:01 +09:00
Mike Blumenkrantz 83ff889f6d eina: fix eina_tiler_equal to not always return true
ref e3f4f4457d
broken by D996

@fix
2017-07-14 18:43:00 -04:00
Mike Blumenkrantz 47ddbede05 eina: make tiler function params const where appropriate
stop throwing warnings when passing const params to functions which don't
modify the params
2017-07-14 18:43:00 -04:00
Stefan Schmidt 9e3ff96f7b eina: inarray: remove documentation pointer to non-existing functions
These do not longer exist in our current code base (did they ever?).

Thanks a lot to Vincent Torri for spotting this!
2017-07-13 11:21:59 +02:00
Al Poole 9aeaef55c4 eina_file: fix unmap of unmapped region when Eina_File has copied data and not a map;
Summary:
This was causing problems on non-Linux architectures as eina_file_real_close unmapped not mapped data. Added a "copied" flag to Eina_File which is set on eina_file_virtualize (on copied data), and tested for when eina_file_real_close does the unmap. I'm surprised Linux allowed this. Certainly all of the BSDs crashed with the previous behaviour.

@fix T5479

Test Plan: Example inlcude Rage and Enlightenment Thumb on BSD systems which use eina_file_virtualize with emotion to obtain album artwork.

Reviewers: raster, cedric, jpeg

Reviewed By: jpeg

Maniphest Tasks: T5479

Differential Revision: https://phab.enlightenment.org/D5006
2017-07-07 13:22:53 +09:00
Carsten Haitzler eeb1eb1b74 eina - fix eina_file_virtualize to copy data to an aligned addr
so we copy data to an UNALINED memory address (just after whatever
string we packed on the end of the eina file struct header). this is
bad. especially for non-intel architectures. this forces a 16 byte
alignment which should cover us.

@fix
2017-07-07 12:08:01 +09:00
Jean-Philippe Andre daf87093f8 eina file: Fix rare crash in line iteration
I'm not sure about the rest of this code, so it's possible that
the index is increased even if it shouldn't. But I've observed
a crash at this line, apparently when reaching the end pointer.
2017-07-03 16:23:40 +09:00
Jean Guyomarc'h 077791b7cc eina,ecore_cocoa: fix detection of the macOS SDK version
There was trouble with Homebrew's CI to build EFL on a macOS < 10.12
which uses a 10.12 SDK. See PR #13252 on github, Homebrew/homebrew-core
for details.

@fix
2017-06-27 23:14:31 +02:00
Mike Blumenkrantz 7b4e9f5d77 eina_log: make a log level of 0 disable the log domain
this has always been specified in the docs as the means by which a log domain
is disabled

@fix
2017-06-23 17:43:44 -04:00
Daniel Zaoui 716cc6be5b Eina Debug: include Evil for realpath support 2017-06-11 10:03:53 +03:00
Daniel Zaoui 0e947166aa Eina Debug: fix a bug resulting in registering opcodes twice
The opcodes registration request is sent directly in case the connection
is already made. Otherwise, the request is waiting for the connection to
be made by the dedicated thread (not the main loop).
That's why the request can be sent by the two different threads at the
same time, leading to send it twice. It means a callback for an opcode
would be invoked twice everytime a request with this opcode is received.

This patch fixes it by checking if the request has already been sent.
2017-06-11 09:44:57 +03:00
Al Poole a7e8dff3e4 eina: fix implicit declaration of pthread_set_name_np in eina_debug.
Summary: Checks and includes necessary headers (FreeBSD et. al)

Reviewers: cedric

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-08 13:36:25 -07:00
Cedric BAIL 634715a2ca eina: as we use string.h function in this inline function, we better include it.
Reported by @netstar, thanks.
2017-06-08 11:41:39 -07:00
Cedric BAIL 1aa2b6de14 eina: enable fallthrough warning suppression only on GCC 7 and above. 2017-06-06 09:57:14 -07:00
Jérémy Zurcher 81bcc14615 eina: fix clang compilation with EINA_FALLTHROUGH
btw, using clang 4.0.0, I can't produce fallthrough warnings using
-Weverything, -Wall or -Wimplicit-fallthrough
2017-06-06 09:58:06 +02:00
Cedric BAIL 2995cc16b7 eina: add EINA_FALLTHROUGH to disable warning on useful case serie with no break.
GCC has started introducing a detection for series of case in a switch statement
without break for each case. We do use that trick a lot to reduce our code base.
Even if in most case we have documented this so that people using coverity don't
try to fix it. Now with GCC we need to silence it properly to avoid future
problem.
2017-06-05 12:07:57 -07:00
Cedric BAIL e83914d496 eina: silence gcc warning.
Code is correct and won't lead to a case where size is > 0 and buffer
isn't set, but gcc can't see the relation between both variable.
2017-06-05 12:07:57 -07:00
Jean Guyomarc'h cc4c40769d eina: attempt to make the code more portable
This fixes the build on macOS.
2017-06-05 19:06:35 +02:00
Jeeyong Um 89c55209cf Eina_Debug: Fix missing include of signal.h 2017-06-05 20:18:46 +09:00
Daniel Zaoui fa3e54b15e Eina_Debug: Fix config.h usage
It was used inside eina_debug.h that is a public header.
Terminology compilation was failing when including its own config.h.
2017-06-05 11:49:08 +03:00
Daniel Zaoui c0eb231edb Fix Windows compilation
Thanks to vtorri for his help on this delicate issue named Windows
2017-06-05 08:55:38 +03:00
Daniel Zaoui 897fc331ce Set Eina Debug APIs as Beta 2017-06-05 08:55:38 +03:00
Daniel Zaoui ea50cbd2b3 Support endianness 2017-06-05 08:55:38 +03:00
Daniel Zaoui 758bb0557c Support opcodes registration for Windows
A standard static array with symbols whose addresses are only known at
runtime is not supported in Windows.
2017-06-05 08:55:38 +03:00
Daniel Zaoui ab01f3f696 Rename opcodes for a better readability 2017-06-05 08:55:38 +03:00
Daniel Zaoui 9e47089311 Remove alloca of potential big size 2017-06-05 08:55:38 +03:00
Daniel Zaoui 6e1eb7193d Bt: Remove special handling for mainloop 2017-06-05 08:55:38 +03:00
Daniel Zaoui 253d3ffe44 Remove thread management
The handling to forward requests is let to the callbacks.
2017-06-05 08:55:37 +03:00
Daniel Zaoui 2ff96adcc1 Removes modules feature 2017-06-05 08:55:37 +03:00
Daniel Zaoui 6e93528f41 Init the communication with the daemon from the debug thread 2017-06-05 08:55:37 +03:00
Daniel Zaoui d6e3ab67db Replace shell remote connection with localhost TCP connection 2017-06-05 08:55:37 +03:00
Daniel Zaoui 36959014d3 Remove _session variable as it is not needed anymore 2017-06-05 08:55:37 +03:00
Daniel Zaoui 27228d3dc1 Add data to opcode registration callback 2017-06-05 08:55:37 +03:00
Daniel Zaoui 8babb55646 Add API to get/set data to session 2017-06-05 08:55:36 +03:00
Daniel Zaoui d970c855ea Add API to get the session dispatcher 2017-06-05 08:55:36 +03:00
Daniel Zaoui bb87302808 Clean code and add comments 2017-06-05 08:55:36 +03:00
Daniel Zaoui 87e68e3ed0 Adapt bt stuff to Eina Debug signal infras 2017-06-05 08:55:36 +03:00
Daniel Zaoui 9fadbc00ad Move internals constants to private h file 2017-06-05 08:55:36 +03:00
Daniel Zaoui 76e5a8f268 Fix Coverity issues 2017-06-05 08:55:36 +03:00
Daniel Zaoui f5cbb61bf4 Add a better support of timers
Now, the timers are handled in one dedicated thread. Multiple timers are
supported.
2017-06-05 08:55:36 +03:00
Daniel Zaoui 39c6a9562b Add shell remote connection
This feature is essential to debug remote applications.
2017-06-05 08:55:36 +03:00
Daniel Zaoui 5251ee326d Fix typo 2017-06-05 08:55:36 +03:00
Daniel Zaoui 6ad0d6ab22 Free packet buffer outside of the dispatcher 2017-06-05 08:55:36 +03:00
Daniel Zaoui cd8b2fc66b Close file descriptor when the session is terminated 2017-06-05 08:55:36 +03:00