Commit Graph

1192 Commits

Author SHA1 Message Date
Yeongjong Lee 02d83ebcd4 docs: Fix typos in API reference doc and comments.
Reviewers: Hermet, segfaultxavi

Reviewed By: Hermet, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6948
2018-08-31 17:45:31 +09:00
Wonki Kim 3ea6f58ec6 eina: find a real path of dynamic library
In general case, user library path is specifed as /usr/lib/, however,
if the user library path is specified as /lib/ which is a symbolic link to /usr/lib/,
current eina_prefix_new logic will print warning messages.
(actually the logic finds a /usr/lib/ path once a fallback logic runs)

This patch modifies the logic to find a proper path of lib path even if it is specified as symlink.
Differential Revision: https://phab.enlightenment.org/D6869
2018-08-24 15:48:38 +02:00
Marcel Hollerbach cf74462b76 eina_debug: switch to vpath
Summary:
eina debug was using the xdg runtime dir in a wrong manner. Since the
directory should be only used by the user, and the directory should be
be subject of any other usage. Additionally, apps tend to create files
like: $XDG_RUNTIME_DIR/foo.bar which is probebly not what you want in
$HOME.

ref T7107

Depends on D6747

Reviewers: zmike, stefan_schmidt, #committers

Reviewed By: zmike, #committers

Subscribers: #reviewers, cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7107

Differential Revision: https://phab.enlightenment.org/D6748
2018-08-20 12:59:15 -04:00
Marcel Hollerbach 7968a0d0b9 move efreet xdg envvars to eina
Summary:
The contents of the XDG_ env vars are also usefull for eina subsystems,
thus we should init those env vars here.

Depends on D6751

Reviewers: zmike, stefan_schmidt, #committers

Reviewed By: zmike, #committers

Subscribers: #reviewers, cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6744
2018-08-20 12:57:57 -04:00
Marcel Hollerbach e31ce7b287 eina_vpath: introduce eina_vpath in style of snprintf
Summary:
this can be usefull for later regactor usages.

Depends on D6742

Reviewers: zmike, stefan_schmidt, #committers

Reviewed By: zmike, #committers

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

Tags: PHID-PROJ-55rnlag4d454jfmlmuhu

Differential Revision: https://phab.enlightenment.org/D6743
2018-08-20 12:56:51 -04:00
Marcel Hollerbach aa416afffb eina_vpath: fix homedirectory fetching
Summary:
the fetching of the homedirectorty did not work. pw_dir was never
prepended. Additionally you would get a silent NULL string back
if the system does not support HAVE_GETPWENT.

ref T7107

Depends on D6737

Reviewers: zmike

Reviewed By: zmike

Subscribers: #reviewers, raster, vtorri, cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7107

Differential Revision: https://phab.enlightenment.org/D6742
2018-08-20 12:56:30 -04:00
Shinwoo Kim cbe9b6f770 eina_file: check copied using copied
Summary:
From (1) "the following commit" message, the changed condition in this patch
should check if the virtualized file is copied or not.

In eina_file_virtualize
head_padded = 16 * ((sizeof(Eina_File) + slen + 15) / 16);
file->global_map = ((char *)file) + head_padded;

In eina_file_dup
file->global_map != (void*)(file->filename + strlen(file->filename) + 1)

Because of this discord condition makes eina_file_dup copies always.

(1) This is "the following commit":
commit 4766316935
Author: Cedric Bail <cedric@osg.samsung.com>
Date:   Wed Mar 8 10:13:36 2017 -0800

    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

Reviewers: zmike, Hermet

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6857
2018-08-17 12:42:18 -04:00
Bryce Harrington 1320ba435e eina: Add doxygen in/out tags for safepointer, safety_checks, slice, etc.
Reviewers: netstar

Reviewed By: netstar

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

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6833
2018-08-15 09:54:17 +01:00
Marcel Hollerbach 55a2e77d60 eina_vpath: specilice the eina_vpath headers
Summary: For now its beta, and the since tag is added.

Reviewers: zmike

Reviewed By: zmike

Subscribers: #reviewers, kimcinoo, Hermet, cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6751
2018-08-14 17:09:22 -04:00
Bryce Harrington dd5a78d9c3 eina: Add doxygen in/out tags for rectangle
Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6776
2018-08-08 13:52:25 +09:00
Bryce Harrington 3524d48719 eina: Add doxygen in/out tags for value and value_util
Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6713
2018-07-31 16:40:43 -04:00
Bryce Harrington 14aeb24483 eina: Add doxygen in/out tags for rbtree
Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6709
2018-07-31 15:27:09 -04:00
Bryce Harrington 28d359b00c eina: Add doxygen in/out tags for quaternion
Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6708
2018-07-31 15:16:53 -04:00
Bryce Harrington dc2ad11281 eina: Add doxygen in/out tags for promise
Summary: Also, add some missing param docs, and fix some incorrect ones.

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6698
2018-07-31 02:51:02 -04:00
Bryce Harrington 185f2f55fd eina: Add doxygen in/out tags for mmap and module
Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6691
2018-07-28 11:50:49 -04:00
Bryce Harrington 06e7c859c9 eina: Add doxygen in/out tags for log
Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6690
2018-07-27 20:20:44 -04:00
Bryce Harrington 49554b2b6c eina: Add doxygen in/out tags for lalloc and list
Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6688
2018-07-27 03:59:44 -04:00
Bryce Harrington ff5cc5d988 eina: Add doxygen in/out tags for inlist and iterator
Reviewers: segfaultxavi

Subscribers: segfaultxavi, cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6686
2018-07-26 20:04:46 +09:00
Bryce Harrington 6fb4608458 eina: Add doxygen in/out tags for evlog, file, fp, freeq
Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6673
2018-07-24 08:30:08 -04:00
Bryce Harrington d9515f002a eina: Add doxygen in/out tags for cow, cpu, and debug
Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6642
2018-07-20 10:36:24 -04:00
Bryce Harrington 582d342afe eina: Fix doxygen in/out tags for eina_bezier
Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6630
2018-07-19 15:51:53 +09:00
Bryce Harrington 096c01a818 eina: Add doxygen in/out tags
Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6624
2018-07-18 15:21:07 +09:00
Daniel Hirt 93397449d4 Eina binbuf: add explicit null-check before magic-check
Summary:
Using `--disable-magic-debug` defines EINA_MAGIC_CHECK to always
evaluate to `1`. Eina_Binbuf's null-check relied solely on the
EINA_MAGIC_CHECK, and failed to pick up on the cases where `buf` was
passed as NULL. This has led to  a segfault when a NULL `buf` was passed
in the test suite (see referenced ticket).

This fix adds an explicit NULL check.

Fixes https://phab.enlightenment.org/T7147

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6592
2018-07-16 06:09:38 -04:00
Bryce Harrington 45173fa375 eina: Add doxygen in/out tags for strbuf's and ustrbuf's parameters
Reviewers: devilhorns, Hermet

Reviewed By: Hermet

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6586
2018-07-13 18:23:27 +09:00
Bryce Harrington bdb9a41750 eina: Spelling fixes
Reviewers: devilhorns, Hermet

Reviewed By: Hermet

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6570
2018-07-12 16:27:15 +09:00
Bryce Harrington 6a68e51460 eina: Add doxygen in/out tags for binbuf's parameters
Reviewers: devilhorns, Hermet

Reviewed By: Hermet

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6571
2018-07-12 16:14:42 +09:00
Bryce Harrington d7c67febe1 eina: Improve documentation for binbuf/strbuf/ustrbuf
Summary:
These three classes have essentially the same API, just different
underlying data types.  This patch seeks to improve the docs for all
three while retaining or improving the consistency between them.

Several functions had completely incorrect documentation (looks like
cut-and-paste mistakes), others had missing or incorrectly named
parameter documentation, typographical errors, or other similar issues.
This also cleans up a lot of spelling and grammar errors, defines return
values as part of @return, and reformats/revises doxygen code for
consistency.

There are no changes to code, except some whitespace cleanup.

Reviewers: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6544
2018-07-10 10:55:10 +09:00
Stefan Schmidt 695b44526c eina: remove no longer used function _eina_thread_queue_msg_block_real_free
Summary:
It seems this function is no longer used since some rework. Clean it up.
lib/eina/eina_thread_queue.c:127:1: warning: ‘_eina_thread_queue_msg_block_real_free’ defined but not used [-Wunused-function]

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6537
2018-07-09 10:22:59 -04:00
Bryce Harrington cc345edccd eina: Improve eina_binbuf function documentation
Summary:
Define return values as part of @return.
Cleanup grammar.

Reviewers: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6503
2018-07-04 11:12:57 +09:00
Bryce Harrington f3512bec57 eina: Improve eina_benchmark function documentation
Summary:
Define return values as part of @return.
Clarify that the returned list of files are gnuplot filenames specifically.
Cleanup grammar throughout.

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6502
2018-07-03 14:44:41 -04:00
Mike Blumenkrantz 7c50209baa eina/debug: remove global lock for session list access
this list is now only accessed from the main thread so there's no reason
to have a lock for it
2018-07-03 16:10:23 +02:00
Mike Blumenkrantz e7e1560e18 eina/debug: rework session thread destruction to avoid deadlock on shutdown
when debugging was active, this would frequently result in the monitor thread
blocking in a read() call for a fd which had already been closed by the main
thread. the main thread would be waiting for the monitor thread to fail its read()
and destroy itself, but the read() would never end without an interrupt

this reworks the monitor thread destruction to stop relying on the thread to
remove its session from the session list and instead only access the list from
the main thread, allowing sessions to always be immediately destroyed

fix T7103
2018-07-03 16:10:21 +02:00
Carsten Haitzler 194971342b eina debug - fix setuid process shutdown by initting fully except conn
init eina debug fully except for the debug daemon connection that the
setuid check was meant to skip. this fixes T7055
2018-06-27 14:13:00 +09:00
Xavi Artigas 80baf516a3 Revert "eina: provide full string length to vsnprintf to allow for null character"
Summary:
This reverts commit e0f8e65d20 which changed the
behavior of eina_stringshare_nprintf() and was not really needed to fix T6903.

Reviewers: zmike, Jaehyun_Cho, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6903

Differential Revision: https://phab.enlightenment.org/D6431
2018-06-26 12:38:22 -04:00
Mike Blumenkrantz b0cb3b935a eina/threadqueue: use mempool_del for hash free function
Summary:
I typod this in 14ae3e3dec and when using
mempools other than chained, this probably caused all apps to crash on
shutdown

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6428
2018-06-25 17:55:25 -04:00
Mike Blumenkrantz 83bab7cab4 eina/lock: add errno wrapping for backtrace() calls in thread debug blocks
Summary:
somehow backtrace() is able to generate EINVAL in certain cases even though
this is not documented anywhere. these irrelevant errors should not be noticed
by users of the api during debugging, as this can cause some tests/apps to
randomly fail without explanation

@fix

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6377
2018-06-25 15:20:37 -04:00
Mike Blumenkrantz b3b104a1e7 eina/debug_cpu: rework thread usage
Summary:
this changes the explicit pthread usage (and reimplementation of eina_thread_create)
to just use eina function calls. it also causes the thread to start and stop when
profiling is enabled and resolves some possible errors which could occur after
a fork or when trying to compile under windows

pthread usage: this code appears to have been 100% copied from eina_thread.c, and it
isn't clear to me why existing eina_thread api was not used. this has no functional
benefit, but it makes the code more readable

thread lifetime: there is no need to have a thread running at all times for a feature
which will be rarely used and which must be explicitly enabled by the user

windows: this file previously generated a lot of compiler warnings from unused functions
and variables since nothing here is available under windows. the entire file is now
a giant #ifndef _WIN32 to avoid any compile warnings or unexpected runtime behavior

fix T7055
Depends on D6371

Reviewers: ManMower, vtorri, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7055

Differential Revision: https://phab.enlightenment.org/D6372
2018-06-25 15:17:14 -04:00
Mike Blumenkrantz 3562878e21 eina/debug: replace some explicit pthread_t usage with Eina_Thread
no functional changes

Differential Revision: https://phab.enlightenment.org/D6371
2018-06-25 15:17:14 -04:00
Mike Blumenkrantz aedaa7ed19 eina/lock: rework meaning of EINA_DEBUG_THREADS variable
Summary:
previously this used to mean 'the number of ms that a lock can wait for
until abort() is called once the lock is acquired' and it was useful
when trying to find contention issues with locks

unfortunately this required a bit of reading into the code to determine,
and it made the common case of setting values to 1 fail in some cases,
as this is a very short amount of time. also the documentation explicitly
gives '1' as an example setting for this variable, which will cause immediate
abort() in most cases when debugging was enabled since things are much slower

this variable now is the number of usec that a lock can wait for before abort()
is called, and the lowest value that will be checked for abort()ing is 100, meaning
that '1' is valid again
Depends on D6375

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6376
2018-06-25 15:15:34 -04:00
Mike Blumenkrantz 6b91b6a389 eina/lock: when debug threads are enabled, always call trylock in lock function
Summary:
when debugging thread issues, it's not actually helpful to immediately
deadlock--this defeats any attempt at debugging. instead, call trylock first
in order to detect a possible deadlock and then throw an error which can be
caught by the user
Depends on D6374

Reviewers: ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6375
2018-06-25 15:15:32 -04:00
Mike Blumenkrantz 73ba4006bd eina/lock: reorder inline posix lock functions
Summary: no functional changes

Reviewers: ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6374
2018-06-25 15:15:29 -04:00
Mike Blumenkrantz 14ae3e3dec eina_thread_queue: use normal mempools for block allocation
there's no need to reimplement mempools here when we already have a great
mempool api

this makes the code slightly more readable

Differential Revision: https://phab.enlightenment.org/D6353
2018-06-25 15:14:30 -04:00
Marcel Hollerbach 592de0e4b6 eina_stringshare: cast in order to fix a warning
Summary:
casting here is safe, as before we check and return on size < 1.
Depends on D6379

Reviewers: devilhorns, Hermet

Reviewed By: Hermet

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6380
2018-06-25 14:55:13 +09:00
Carsten Haitzler 9639fab82b Revert "Revert "eina debug - fix segv if an app is compiled with -pg for profiling""
This reverts commit 0d91088d0f.

It also includes a workaround for OSX where RT signals aren't
supported due to kernel age (too old a fork of freebsd). fixes D6310
and T7029
2018-06-22 10:07:49 +09:00
Mike Blumenkrantz 46081e4e6a eina_debug_bt: add ifdef for windows build
Summary: ref D7028

Reviewers: vtorri, devilhorns

Reviewed By: vtorri

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6348
2018-06-21 17:44:46 -04:00
Daniel Kolesa 1bcdc8af7b efl: include sys/types.h where ssize_t is used
This include is necessary according to POSIX. Without it, build
fails on certain platforms (QNX). It may already be included
implicitly in some of those files, but declare intent.

Fixes T6667.
2018-06-21 14:09:59 +02:00
Mike Blumenkrantz 217f30001a eina_debug_bt: only enable SIGPROF handler when profiling is enabled
Summary:
if profiling is not enabled then reaching this signal handler will always
result in a crash

moreover, the signal handler has no functional value if profiling is not active,
so do not add it until that point

fix T7028

@fix
Depends on D6311

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7028

Differential Revision: https://phab.enlightenment.org/D6312
2018-06-19 14:04:45 -04:00
Mike Blumenkrantz 1de5c251d1 eina_debug: add function to reset debug subsystem after fork
fork() kills this entire subsystem and leaves its internals
in an inactive but allocated state, so it's necessary to explicitly restart
everything in order to guarantee behavior

@feature

Differential Revision: https://phab.enlightenment.org/D6307
2018-06-19 13:55:36 -04:00
Mike Blumenkrantz bd9edfad00 eina_debug: make shutdown perform cleanups and kill the timer thread
this should not remain active after eina has been deactivated, so ensure
that everything stops as expected

ref T7019

Differential Revision: https://phab.enlightenment.org/D6306
2018-06-19 13:55:36 -04:00
Mike Blumenkrantz 9d2d1a2677 eina_debug_cpu: make shutdown perform cleanups and kill the timer thread
this should not remain active after eina has been deactivated, so ensure
that everything stops as expected

ref T7019

Differential Revision: https://phab.enlightenment.org/D6305
2018-06-19 13:55:36 -04:00