Commit Graph

1327 Commits

Author SHA1 Message Date
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
Daniel Zaoui 5f268ec26a First patch of the Eina Debug layer rewriting
Eina Debug is a new layer aimed for EFL debugging. It offers scalability
by allowing registration of operations not specific to EFL core.

The protocol is simple and the APIs try to provide as much
functionalities/freedom as possible.
2017-06-05 08:51:49 +03:00
Jeeyong Um 0e78ecb325 eina: Fix broken link in doc to introduce integer hash algorithms 2017-05-30 13:34:34 +09:00
Cedric BAIL 26d401351d eina: fix reproductible build.
This make eina hamster depend on when configure was generated. This
should only happen really when we make a new tarball for release.

@fix

T5495
2017-05-18 16:20:06 -07:00
Prasoon Singh 9c62ab525b eina: fix for escapable charachters not getting escaped if it comes after '\t' or '\n'
Summary:
Escaping is not happening whenever any escapable characters is coming after
'\t' or '\n'. It will also fix invalid read of 1 byte which happens for string where
last charachter is '\t' or '\n' like "eina\t".

Test Plan:
Take a string like "eina\t ". Observe space which is followed by tab is not getting
escaped.

Signed-off-by: Prasoon Singh <prasoon.16@samsung.com>

Reviewers: shilpasingh, rajeshps, govi, cedric

Reviewed By: shilpasingh

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-05-09 10:37:16 -07:00
Mike Blumenkrantz ab67217434 eina_tiler: use int size matching Eina_Rectangle internally to avoid overflow
since this code's creation it seems that the internal int size was set to use
short in order to micro-optimize memory usage, while the api function parameters
used Eina_Rectangle which had a larger int size. when initializing the internal
rect struct, this would lead to overflows which resulted in broken tilers which
returned iterators with no valid rects after having valid rects added

test case: run weston-subsurfaces

@fix
2017-04-21 16:16:12 -04:00
Cedric Bail 8187e34741 eina: some architecture don't like prefetch on NULL apparently. 2017-04-21 11:29:38 -07:00
Carsten Haitzler f077fb1e0d eina mmap - fix warnings thanks to missing include
add include for eina_file.h
2017-04-21 16:38:40 +09:00
Carsten Haitzler b26276a7e9 eina debug - fix include of eina_file.h that was missing
fixes new warnings
2017-04-21 16:38:18 +09:00
Cedric BAIL b2893dfc77 eina: use new API eina_file_close_on_exec. 2017-04-18 16:54:03 -07:00
Cedric BAIL 9d8549f7a3 eina: add an API to correctly do close on exec. 2017-04-18 16:53:26 -07:00
Carsten Haitzler 330368c10c eina log - try and fix coverity complaint about integer overflow again
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.

CID 1361219
2017-04-18 17:30:50 +09:00
Carsten Haitzler f3f032e63f eina log - try and fix coverity complaint about integer overflow again
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.

CID 1361220
2017-04-18 17:30:50 +09:00
Ivan Furs 0e7ee821cd eina: For Windows fix crash when the file was opened many times.
Summary:
A similar problem as:
    commit 62b469749a

Reviewers: NikaWhite, t.naumenko, an.kroitor, FurryMyad, cedric, raster, vtorri, rimmed

Reviewed By: raster

Subscribers: artem.popov, cedric, jpeg

Tags: #windows, #efl

Differential Revision: https://phab.enlightenment.org/D4788
2017-04-17 11:51:05 +09: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
Vincent Torri eff7bab48f Eina_Value: strdup() is used, so include string.h 2017-03-27 08:22:06 +09:00
Artem Popov 8d6c90351c Eina_Xattr: fix memory corruption
Summary:
There should be reallocation +1 (for last '\0') and also
checking >0, not !=0, because of getxattr can return -1 in case of error
@fix

Reviewers: cedric, raster, NikaWhite, jpeg

Reviewed By: NikaWhite

Subscribers: myoungwoon

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D4734
2017-03-23 16:27:22 +02:00
Marcel Hollerbach 12d01c1259 eina_debug: do not leak a spinlock when the path is not given 2017-03-18 22:10:43 +01:00
Ivan Furs 4d13273e3b eina_file: fixed T2244
Summary:
dirty fix for 'eet' problems with file deletion on WINDOWS
to work with the commit: D4698, D4699

Reviewers: cedric, NikaWhite, rimmed, vtorri, raster

Reviewed By: cedric

Subscribers: artem.popov, cedric, jpeg

Maniphest Tasks: T2244

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-03-15 10:49:55 -07:00
Chris Michael 3fa7570bda eina: Fix more typo in doxygen
The eina_(rw)_slice_startswith functions both incorrectly describe how
the 'prefix' parameter is used, so fix those also

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-03-13 15:50:37 -04:00
Chris Michael 47f34bb7a3 eina: Fix typo in doxygen
eina_(rw)_slice_startswith functions both incorrectly describe the
return value as 'slice ends with', when clearly the function is used
to find if a slice 'starts with' a prefix

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-03-13 12:11:46 -04:00
Cedric Bail 4766316935 eina: force copy of not copied virtualized file while doing an eina_file_dup.
The other way around is pretty much impossible as you don't know who does
an eina_file_dup and for how long they keep there reference.

T5234
2017-03-08 12:24:41 -08:00
Ivan Furs 8a10ef10cb eina_file: delete handle->fm(handel of function CreateFileMapping)
Summary: CreateFileMapping return handle. The handle before use is always closed. This handle can be immediately closed after use.

Reviewers: cedric, raster, vtorri, rimmed, an.kroitor, FurryMyad, NikaWhite

Reviewed By: raster

Subscribers: artem.popov, cedric, jpeg

Tags: #windows

Differential Revision: https://phab.enlightenment.org/D4699
2017-03-06 19:18:46 +09: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 1974f5d511 eina_value: Fix min/max values of long for Windows
long is 32 bit on Windows (both 32, 64 bit).

I wonder why eina_value doesn't simply use LONG_MIN/MAX O_o

Fixes T5204
2017-02-28 16:25:18 +09:00
Flavio Ceolin 1cbd32aca1 eina:list: Fix resource leak
Summary:
The usage of the macro EINA_MAGIC_CHECK_LIST can
lead (in some cases) to leaks.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4679
2017-02-28 16:00:45 +09:00
Myoungwoon Roy, Kim ec71f6607a docs: Fix typos and some wrong expressions in Eina API reference doxygen.
Summary: I had fixed some typos and some wrong expressions, such as capital letters, singular, and orders of groups in Eina API reference doxygen.

Test Plan: Doxygen Revision

Reviewers: stefan, cedric, raster, Jaehyun_Cho, jpeg

Reviewed By: jpeg

Subscribers: conr2d

Differential Revision: https://phab.enlightenment.org/D4674
2017-02-21 10:46:28 +09:00
Mykyta Biliavskyi 94eaa792c2 eina utils: fix build without getpwent.
If HAVE_GETPWENT isn't defined - the closing brace was missed.
Also prevent situation when strdup() tried to duplicate NULL
pointer, because that could cause segfault.

@fix
2017-02-20 11:29:56 +02:00
Stefan Schmidt 539bc7552b eina_strbuf / eina_ustrbuf: add since tags for newly added APIs
These six have been added in this cycle but missed the since tags.
2017-02-15 12:31:50 +01:00
Stefan Schmidt b9524b6aa5 eina_lock: add since tag to now exposed eina_lock_debug API
This function was static inline before but form 1.19 onwards its EAPI so give
it a since tag.
2017-02-15 12:31:50 +01:00
Stefan Schmidt b6f84653d4 eina: binbuf: add since tags new append_slice and insert_slice APIs 2017-02-15 12:31:50 +01:00
Stefan Schmidt 73349edc19 eina: make the ein_file_unlink symbol availbale form the ein_file header
It was only defined in the c file. Without any documentation, since tag, etc.

tests/eina/eina_test_file.c:855:4: warning: implicit declaration of function ‘eina_file_unlink’
[-Wimplicit-function-declaration]
2017-02-13 14:30:27 +01:00
Carsten Haitzler d04cd6af10 eina inlist - cast container via void ptr to avoid warnings
we really can't do much here but our direct casting causes warnings in
apps or anyone using this macro so keep things silent as our pointer
tricks are actually ok but the compiler can't figure it out.
2017-02-12 14:45:04 +09:00
Carsten Haitzler ba3ac16b62 evlog/log bt - fix size casting tot stop warning when printing errs 2017-02-12 00:32:22 +09:00
Carsten Haitzler 1a481cfe4d eina utils and vpath - use euid not uid if setuid for correct user
was using uid not euid for "if setuid use safe way to get location" -
ie the user that effectively owns the process, not nominally.

@fix
2017-02-09 18:50:15 +09:00
Carsten Haitzler bb9bb20000 eina debug monitor - dont use XDG_RUNTIME_DIR if setuid
avoids possible issues with debug monitor + setuid
2017-02-08 21:19:39 +09:00
Carsten Haitzler 944ce7ef41 elm config - handle profile name of ".." as its obviously invalid
this forbids .., as a profile name in addition to the existing "stip /
from profile name".
2017-02-08 21:19:39 +09:00
Carsten Haitzler 8094893877 eina utils - home and tmp environ - store statitcally and handle setuid
if setuod we dont want to trust HOME environ at all and get it from
passwd file... also we dont want to keep re-getting too... so store
statically as well as tmp.

this also kind of helps CID 1366469
2017-02-08 21:19:39 +09:00
Carsten Haitzler 7b736d20b8 eina share - fix spinlock release if magic check fails on share data
this fixes a potential double spinlock unrelease if magic check fails
on share data. this fixes CID 1367493
2017-02-08 21:19:39 +09:00
Carsten Haitzler 34883a12e7 eina freeq - fix possible seg with NULL freeq and pattern fill logic
this fixes handling of a NULL freeq handle - found by coverity.

fixes CID 1369021
2017-02-08 08:48:35 +09:00
Ivan Furs 808fcf4dae eina_file: add eina_file_unlink
Test Plan: split  D4423 - unlink

Reviewers: raster, vtorri, an.kroitor, jpeg, reutskiy.v.v, NikaWhite, cedric

Reviewed By: cedric

Subscribers: artem.popov, cedric, vtorri, jpeg

Tags: #windows, #efl

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-07 15:14:54 -08:00
Carsten Haitzler 1b53925b4c evlog - fix "remove setting stack var to 0" that broke evlogs
this fixes b38c610c7e - recent commit by
me. bad me! spank!
2017-02-02 14:01:10 +09:00
Carsten Haitzler b44093c193 eina log bt - make it an eaven easier copy & paste to get a bt now
just copy & paste into a terminal and hit enter.
2017-01-31 23:01:50 +09:00
Carsten Haitzler b38c610c7e evlog - remove setting stack var to 0 until it is needed later
we set stack var to 0 even if evlog was off and thus didn't use it.
this cleans up the evlog func a bit and also moves locking until later
so it's locked for the minimum period to punt something into the log
buffer. it's an improvement, but no bug fix.
2017-01-31 23:01:50 +09:00
Derek Foreman 853adace69 eina_evlog: Don't call get_time prematurely
If we're not logging events this generates a lot of wasted system
calls.  They probably don't amount to much, but it's trivial to
get rid of them, and they make a mess when logging with strace.
2017-01-30 15:28:29 -06:00
Gustavo Sverzut Barbieri 85a095f0a8 cmake: fix strlcpy() detection and usage.
Linux usually ship with strlcpy(), but it's inside bsd/string.h and
needs -lbsd.

On BSD it's inside string.h and libc.
2017-01-26 15:53:14 -02:00
Gustavo Sverzut Barbieri f74ca08be9 cmake/eina: check more required functions and link with unwind if found.
unwind is needed for debug, thus link to that.
2017-01-25 19:29:20 -02:00
Gustavo Sverzut Barbieri fd8865d0d0 cmake: EFL_OPTION() now supports DEPENDS to handle conditionals.
This is now used by ENABLE_SYSTEMD and ENABLE_VALGRIND, which moves to
"common.cmake" since they are shared among multiple libraries.

With that I found that LINK_FLAGS is indeed a string, not a CMake List
(space separated, not ";"), then fix that so compilation actually works.
2017-01-25 19:29:20 -02:00
Gustavo Sverzut Barbieri fa92926469 cmake: major rework of check and pkg-config dependencies.
make FUNC_CHECK(), TYPE_CHECK() and HEADER_CHECK() more general and
they can be set to a scope, like "eina", then all symbols are prefixed
with that. The scope is created with CHECK_INIT(), and
EFL_HEADER_CHECKS_FINALIZE() will finish that.

This makes it possible for cmake/config/eina.cmake +
cmake/post/eina.cmake to add stuff to the generated file, better than
hand edit the template.

CHECK_APPEND_DEFINE(name val) is now the base to add symbols to the
generated file in the current scope.

Then convert cmake/config/eina.cmake to use that and match the
autotools values (were a bit off).

This exposed enabling valgrind was broken due incorrect pkg-config
usage with cmake (it's not obvious), it was using just the libraries,
while LDFLAGS are needed to get -L/usr/lib/valgrind. Then also convert
to CFLAGS provided by pkg-config and make that automatic for
PKG_CONFIG_REQUIRES and PKG_CONFIG_REQUIRES_PRIVATE.

Also, eina-mempool modules use valgrind and must use that now that's
propagating correctly.
2017-01-23 23:55:33 -02:00
Gustavo Sverzut Barbieri ec060b4fee cmake/eina: only pthread is public, rt/dl/m are all private. 2017-01-23 19:33:35 -02:00
Marcel Hollerbach f27323395a cmake: eina needs rt
for open_shm
2017-01-23 20:08:55 +01:00
Gustavo Sverzut Barbieri 76e68de5d6 EflMacros: auto-handling of pkg-config files. 2017-01-23 18:23:40 +01:00
Gustavo Sverzut Barbieri d9815a6837 CMake: move eina binaries to single dir, add helper macros.
For one-source directories, be smart and just define SOURCES to that,
will reduce the number of too-simplistic CMakeLists.txt in our tree.

This also fixes problems with libraries, they should be private, not
public. So specify both kinds as different variables.
2017-01-23 18:23:40 +01:00
Gustavo Sverzut Barbieri 3d5abc081f EflMacros: major improvements towards usability.
Stick to one target per directory and remove prefix from variables,
makes it cleaner and easier to use.

Document variables used and use a more consistent name that matches
CMake properties.
2017-01-23 18:23:40 +01:00
Gustavo Sverzut Barbieri dee24c3821 CMake: rework to use some helper macros.
This tries to defines some macros to create a cleaner build system.
2017-01-23 18:23:40 +01:00
Marcel Hollerbach 88283204c1 build: switch eina to half baked cmake 2017-01-23 18:23:40 +01:00
Jean-Philippe Andre ffbc0645e5 eina: Remove EAPI eina_freeq_main_set()
I believe this function is not required and should not be
used by applications. If there is a very good use case to
use your own main freeq, then the API could be added again.

For now, removing the set() is probably the safer option.

Note: the API was introduced in the upcoming 1.19
2017-01-17 14:21:17 +09: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
Cedric BAIL 8e7d7d9d58 eina: move to use memcmp and rename eina_{flt,dbl}eq to eina_{flt,dbl}_exact. 2017-01-06 15:58:46 -08:00
Cedric BAIL 89f429c0e7 eina: switch to equal FP_ZERO with fpclassify. 2017-01-06 15:58:46 -08:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Mike Blumenkrantz 16d28c6bc8 eina: add macros for determining whether floats are nonzero
this is a commonly-used functionality, so make it faster to write

@feature
2017-01-06 12:57:08 -05:00
Mike Blumenkrantz 1b4c26be8e eina: add functions for warningless exact comparisons of floats
in some cases a user does want to check exact values, so these functions
should be used to indicate this intent

needs windows support

@feature
2017-01-06 12:57:08 -05:00
Marcel Hollerbach 04c0e5609c eina: fix up last commit
i am sorry. I missed that i just freed the string and not the complete
buf. This now really frees the buf.
2017-01-06 13:02:37 +01:00
Marcel Hollerbach 4d6d177ff7 eina_buf: replace eina_strbuf_free_return with eina_xXxbuf_release
The api name free_return wasnt a good choice so it is changed to
release. This also moves the implementation to binbuf template so it is
available in all buf types.
2017-01-06 12:45:27 +01:00
Carsten Haitzler c7d23534d9 eina - fix redefinition of word size if already defined 2017-01-06 19:25:50 +09:00
Cedric BAIL 273238d725 eina: try to provide __WORDSIZE to system that don't have it aka OpenBSD. 2017-01-05 16:33:59 -08:00
Marcel Hollerbach 2f1d0fb189 eina_strbuf: add eina_strbuf_free_return
Summary:
For a function which just composes a string with strbuf its quite
usefull to return the string while its freed.

This makes a function like:

{
   Eina_Strbuf *buf;
   char *path;

   buf = eina_strbuf_new();
   eina_strbuf_append(buf, "test");
   eina_strbuf_append_printf(buf, "%s-%d.edj", "test", 0);
   path = eina_strbuf_string_steal(buf);
   eina_strbuf_free(buf);
   return path;
}

To:

{
   Eina_Strbuf *buf;

   buf = eina_strbuf_new();
   eina_strbuf_append(buf, "test");
   eina_strbuf_append_printf(buf, "%s-%d.edj", "test", 0);
   return eina_strbuf_free_return(buf);
}

Which is a bit more handy.

Test Plan: just run make check

Reviewers: raster, cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4545
2017-01-05 14:08:23 +01:00
Carsten Haitzler d5e88e4cf9 eina freeq - add ability to set freeval and add a final freeval
this allows environment variables to set the byte falue to fill a
freeq item added to the queue and then another item to actually fill
memory with just before the free function so memory content difference
will tell you if its inside the free queue or already freed from it
completely. if you set tyhe freed value to 0 this will not fill with a
value just before free and leave the value as-is determined by the
first fill pattern value.
2016-12-21 15:44:15 +09:00
Carsten Haitzler ffefbe0718 eina freeq - add explicit bypass on/off env var controls
this fixes T5032
2016-12-21 15:44:15 +09:00
Jee-Yong Um f1ab136abc doxygen: remove reference warnings.
Reviewers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-12-20 16:39:30 -08:00
Marcel Hollerbach 4e9656feac eina: add api for assessing the relative position of two rectangles
Summary:
the api returns if a rectangle is positioned above/below/right or left
of a other rectangle.

Code which does simular things are part of verne and e, i think its a good idea to provide api for that.

Test Plan: Just run the test suite

Reviewers: raster, jpeg, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-12-20 16:39:30 -08:00
Gustavo Sverzut Barbieri 09825cbe5d eina_binbuf: allow expand & usage of extra bytes.
Some code needs to read directly into eina_binbuf to avoid an extra
copy from eina_binbuf_append* variants.

This can be achieved by using eina_binbuf_expand(), which returns a
write-able slice of the spare bytes. Once they are used,
eina_binbuf_use() should be called to increment "buf->len", which is
used by all other binbuf functions such as eina_binbuf_length_get() or
eina_binbuf_append_slice().
2016-12-20 10:18:32 -02:00
Cedric BAIL 701aa35e6e eina fixup bezier 2016-12-19 16:33:46 -08:00
Cedric BAIL 3d0c4ac0f6 eina: fix double comparison in eina quaternion. 2016-12-19 16:33:46 -08:00
Cedric BAIL d94a186584 eina: fix double comparison in eina matrix. 2016-12-19 16:33:46 -08:00
Cedric BAIL 1f6c4b1370 eina: fix double comparison in eina bezier. 2016-12-19 16:33:46 -08:00
Cedric BAIL 7bb229d4be eina: add general purpose function to compar float and double. 2016-12-19 16:33:46 -08:00
Marcel Hollerbach 712ec60012 eina: add free cb to eina_iterator_filter_new
if you allocate memory for the data param data you can free it in this callback.
2016-12-09 10:16:08 +01:00
Jean-Philippe Andre 509cce5e43 eina: Set magic number in eina_file_virtualize
This fixes make check
2016-12-09 11:08:38 +09:00
Jean-Philippe Andre f1d546df5d eina: Set magic type name for Eina_File 2016-12-08 16:30:34 +09:00
Jean-Philippe Andre 208e152baf eina: Reinstall magic checks on Eina_File
file != NULL does not mean it's valid. Since Eina_File is
a basic eina type a magic check is still better than nothing.
It can avoid doing eina_file_dup() on a closed file for instance.

This "fixes" a crash in eina_file_close with invalid files.

Now I can go hunt the root cause...
2016-12-08 16:30:34 +09:00
Stefan Schmidt e90622ec41 all: use void if we really want to make sure we do not accept parameters
In C we need this to make clear that we really do not accept parameters.
Found by the smatch source code matcher. I had run and fixed this before
but it seems to creep in again over time.
2016-12-06 17:16:24 +01:00
Stefan Schmidt 9d37fa2b8b eina: fix same wrong indenting
Brought up by running smatch. We have way to many of such things in tree though
to fix them all without annoying a lot of people. I will just stop here.
2016-12-06 17:16:24 +01: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
Artem Popov 05246782dc eina/log: add ARG_NONNULL to eina_log* APIs for Eina_Log_Domain * parameter
@fix

Summary: add ARG_NONNULL to eina_log* APIs for Eina_Log_Domain * parameter that is always in use, can not be NULL.

Reviewers: cedric, Hermet, myoungwoon, NikaWhite

Reviewed By: NikaWhite

Subscribers: t.naumenko, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-28 11:35:27 -08:00
Gustavo Sverzut Barbieri a9d9936a08 eina_slice: fix eina_slice_endswith() for same-sized slices. 2016-11-25 17:25:18 -02:00
Vyacheslav Reutskiy 56c202614b eina_file_win32: close handler in case of error
Func _eina_file_win32_first_file try to find the first file in directory
but if any file not found the file handler stay open, and func will
return error. But in this case while handle is open impossible to do
any actions. For example call eina_file_ls for empty folder, func will
return error and fold folder open. And if we try to remove this folder
Windows only mark it to delete, and remove it after the process is
complete.

Solution: close handler in error case.
2016-11-23 16:19:55 +02:00
Jee-Yong Um 0f97d45dac fix doxygen warnings
Summary:
fix warnings while generating documents
- end of file while inside a group (eina_util.h)
- missing title after \defgroup
- ignoring title "Ecore_Con_Lib_Group" that does not match old title

Reviewers: Hermet

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4420
2016-11-22 11:47:04 +09:00
Marcel Hollerbach c34e4b6312 eina_iterator: add new api to have a filtered iterator
Summary:
the new iterator represents the order from the elements of the original
iterator, elements where the filter callback return false will be
skipped.

The container of this iterator is the original iterator.

Test Plan: Just run `make check` there is a testcase

Reviewers: cedric, jpeg, raster, herdsman

Differential Revision: https://phab.enlightenment.org/D4417
2016-11-21 12:13:02 +01:00
Carsten Haitzler 6a3a4a4124 eina log - explain how to humanify the output for bts when printed 2016-11-17 18:41:32 +09:00
Jean Guyomarc'h a1e1bb01ba
eina: don't make eina_thread_cancellable_run() inline
Seems to me there is little benefit of inlining this function, but this
also had a pervert effect on Windows and C++ with some recent mingw
versions. Mingw failed its implementation of pthread_cleanup_pop(). It
does not compile when compiled in C++. There is a type mismatch that is
caught by the compiler, and everything goes nuts...

This made the EFL build fail because some files of ecore_win32 are C++
sources, and they require Eina... so this macro appears in a C++ code
indirectly, because of its inlining.

By removing the inlining, this build issue is fixed. Will also fix
builds of other programs that would have used Eina.h in their C++
programs :)
2016-11-15 22:19:58 +01:00
Carsten Haitzler 5c8dfe9873 eina freeq - make bypass setup only on new freeq creation and changable
this will make a freeq bypass that is enabled by using valgrind or env
var not affect a freeq that has manually changed its queue count max
or mem max. these now become explicit deferred freeers.
2016-11-10 16:22:34 +09:00
Carsten Haitzler ce3685f001 evlog - reduce overhead of getting time a little by pre-checking clock
this checks for clock_gettime + CLOCK_MONOTONIC or CLOCK_REALTIME at
evlog init to avoid a cmp+brang and l1 instr cache hit every get.
slightly less overhead when this is on.
2016-11-10 16:22:34 +09:00
Carsten Haitzler 42ebfa863f evlog - no need to take lock to check if evlog is on. fix
this should reduce oerhead of evlog when on by a bit by not
taking+releasing a lock at all in this case.
2016-11-10 16:22:34 +09:00
Carsten Haitzler 9f32f83d45 evlog + efl dbug - add logging of cpu freq and cpu usage per thread
this runs a 1000hz (or as best the kernel will allow) polling system
monitor thread that will logg the cpu frequencies of all cores (linux
only) as well as cpu usage per thread. this leads to much more
information able to be logged from an efl app (any efl app).

@feature
2016-11-10 01:02:22 +09:00
Artem Popov a061f211c0 Eina: add NULL check to eina_module_symbol_global_set API @fix
Summary: Add checking on NULL like in other API in module, to avoid segmentation fault

Reviewers: NikaWhite, cedric

Reviewed By: cedric

Subscribers: myoungwoon, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-07 14:42:54 -08:00
Cedric BAIL de131bf5d0 eina: remove Eina_Promise. 2016-11-07 13:43:11 -08:00
Carsten Haitzler f18d9d7237 remove memcmp calls for better performance where size is known
so i have been doing some profiling on my rpi3 ... and it seems
memcmp() is like the number one top used function - especially running
e in wayland compositor mode. it uses accoring to perf top about 9-15%
of samples (samples are not adding up to 100%). no - i cant seem to
get a call graph because all that happens is the whole kernel locks up
solid if i try, so i can only get the leaf node call stats. what
function was currently active at the sample time. memcmp is the
biggest by far. 2-3 times anything else.

  13.47%  libarmmem.so                [.] memcmp
   6.43%  libevas.so.1.18.99          [.] _evas_render_phase1_object_pro
   4.74%  libevas.so.1.18.99          [.] evas_render_updates_internal.c
   2.84%  libeo.so.1.18.99            [.] _eo_obj_pointer_get
   2.49%  libevas.so.1.18.99          [.] evas_render_updates_internal_l
   2.03%  libpthread-2.24.so          [.] pthread_getspecific
   1.61%  libeo.so.1.18.99            [.] efl_data_scope_get
   1.60%  libevas.so.1.18.99          [.] _evas_event_object_list_raw_in
   1.54%  libevas.so.1.18.99          [.] evas_object_smart_changed_get
   1.32%  libgcc_s.so.1               [.] __udivsi3
   1.21%  libevas.so.1.18.99          [.] evas_object_is_active
   1.14%  libc-2.24.so                [.] malloc
   0.96%  libevas.so.1.18.99          [.] evas_render_mapped
   0.85%  libeo.so.1.18.99            [.] efl_isa

yeah. it's perf. it's sampling so not 100% accurate, but close to
"good enough" for the bigger stuff. so interestingly memcmp() is
actually in a special library/module (libarmmem.so) and is a REAL
function call. so doing memcmp's for small bits of memory ESPECIALLY
when we know their size in advance is not great. i am not sure our own
use of memcmp() is the actual culprit because even with this patch
memcmp still is right up there. we use it for stringshare which is
harder to remove as stringshare has variable sized memory blobs to
compare.

but the point remains - memcmp() is an ACTUAL function call. even on
x86 (i checked the assembly). and replacing it with a static inline
custom comparer is better. in fact i did that and benchmarked it as a
sample case for eina_tiler which has 4 ints (16 bytes) to compare
every time. i also compiled to assembly on x86 to inspect and make sure
things made sense.

the text color compare was just comparing 4 bytes as a color (an int
worth) which was silly to use memcmp on as it could just cast to an
int and do a == b. the map was a little more evil as it was 2 ptrs
plus 2 bitfields, but the way bitfields work means i can assume the
last byte is both bitfields combined. i can be a little more evil for
the rect tests as 4 ints compared is the same as comparing 2 long
longs (64bit types). yes. don't get pedantic. all platforms efl works
on work this way and this is a base assumption in efl and it's true
everywhere worth talking about.

yes - i tried __int128 too. it was not faster on x86 anyway and can't
compile on armv7. in my speed tests on x86-64, comparing 2 rects by
casting to a struct of 2 long long's and comparing just those is 70%
faster than comapring 4 ints. and the 2 long longs is 360% faster than
a memcmp. on arm (my rpi3) the long long is 12% faster than the 4 ints,
and it is 226% faster than a memcmp().

it'd be best if we didnt even have to compare at all, but with these
algorithms we do, so doing it faster is better.

we probably should nuke all the memcmp's we have that are not of large
bits of memory or variable sized bits of memory.

i set breakpoints for memcmp and found at least a chunk in efl. but
also it seems the vc4 driver was also doing it too. i have no idea how
much memory it was doing this to and it may ultimately be the biggest
culprit here, BUT we may as well reduce our overhead since i've found
this anyway. less "false positives" when hunting problems.

why am i doing this? i'm setting framerate hiccups. eg like we drop 3,
5 or 10 frames, then drop another bunch, then go back to smooth, then
this hiccup again. finding out WHAT is causing that hiccup is hard. i
can only SEE the hiccups on my rpi3 - not on x86. i am not so sure
it's cpufreq bouncing about as i've locked cpu to 600mhz and it still
happens. it's something else. maybe something we are polling? maybe
it's something in our drm/kms backend? maybe its in the vc4 drivers or
kernel parts? i have no idea. trying to hunt this is hard, but this is
important as this is something that possibly is affecting everyone but
other hw is fast enough to hide it...

in the meantime find and optimize what i find along the way.

@optimize
2016-11-06 13:13:10 +09:00
Carsten Haitzler ac861be550 eina list - use free queue to defer freeing list nodes and accting
this should help with robustness a little bit by keeping nodes in the
free queue purgatory until enteirng idle etc.

@feature
2016-11-06 13:13:10 +09:00