Being able to indivually initialize individual modules was initially
"good", but at end it's putting complexities on users that would try
to "optimize" by doing just what they used, but in the end most people
would get them wrong, users would have to do lots of code and etc. At
the end it does not worth.
Most module init just register handful errors and log domains, so are
cheap. The exception is mempool users, that would dlopen() stuff, but
people that are concerned (embedded) can just compile those statically
in eina.
Since at the end any real application would use most of modules, we
actually end saving lots of function calls that would do nothing other
than increment a global counter.
I also did the init/shutdown use an array, making it easier to
maintain. The inital dependencies were analysed by a script I wrote, I
hope it's all right.
Please fix any breakages you find!
SVN revision: 42300
Note : currently, because of a circular calls of
eina_log_init() and eina_safety_checks_init(), eina
is not correctly shut down. Imho, eina_log should not
depend on the safety checks module. That would mean
some fprintf in eina_log_domain_new(), eina_log_domain_free(),
eina_log_domain_register()and eina_log_domain_unregister().
SVN revision: 42292
with small modifications and fixing
ecore_evas_win32 does not build, though. I think that
if we add log support in evas, all the macro must have
different names, because of all the _private.h headers
that are included in all source files (that's the problem
with win32). I'll fix ecore_evas_win32 build later. Or
someone can do it if he wants :-)
SVN revision: 42274
write down specialized cases for threads or not, function or file,
color or not. Maybe it's not even an optimization since we add yet
another indirection/function call, but each case is simpler.
* EINA_LOG_FILE_DISABLE=1: disables show of file:line in
stderr/stdout messages.
* EINA_LOG_FUNCTION_DISABLE=1: disables show of function() in
stderr/stdout messages.
one must not use the two options at the same time, if that's the case
code will ignore EINA_LOG_FILE_DISABLE=1 and use just function
disable.
SVN revision: 42272
Users may opt to set EINA_LOG_LEVEL_MAXIMUM to some integer and macro
will then evaluate to check for that value before actually call
eina_log_print() macro. By using optimizations compilers will
effectivelly compile out the code if it is never reached, thus saving
the check and function call in possible critical paths.
SVN revision: 42269
remove debug_level options as it is better handled by EINA_LOG_LEVELS
and EINA_LOG_LEVEL variables, for example:
EINA_LOG_LEVEL=3 EINA_LOG_LEVELS=ethumb:4,ethumb_client=1
will show debug for ethumb (lib), just errors (no warnings) for
ethumb_client library and everything else shows "info".
SVN revision: 42261
Sparse Matrix was implemented and tested by Rafael Antognolli and
myself in order to implement optimized large sparse matrix walk in
some products, one of them WebKit-EFL optimizations.
We have done extensive tests, with good code coverage. Similar to
lists/inlists, we keep pointer to last known element and similar to
iterators we keep reference to last accessed row and cell inside
rows. This allows fast sequential access (for i... for j... m[i,j]),
that is our most common usage case.
Rows are kept in a list, with cells inside that row as another
list. It's not similar to most book implementations where cells keep
reference to their sibling cells in other rows as well, we opted to
not do that to save some pointers and make algorithms simpler, still
do great for our use case.
This code was developed on behalf of our client, that wants to remain
unnamed so far. Thanks client ;-)
SVN revision: 42243
note that one can turn per module debug, for example:
EINA_LOG_LEVEL=4 EINA_LOG_LEVELS=eina_stringshare:0 ./bla
will enable level 4 (debug) for all modules except eina_stringshare
that is forced to 0 (just critical messages).
SVN revision: 42224
All these individual init functions are getting messy, some modules
lack them and it's easy to get inconsistent. Safety check needs error
and log, but these need safety checks as well, some modules (lalloc,
rbtree and others) use safety checks but provide no _init().
I want to know if we really gain something to init individual
modules. It should not be that expensive as init should not allocate
heavy resources and the recommendation is to call eina_init() so most
users will do that anyway.
If people agree I'll unmark all *_init() as EAPI and make them private
to eina lib.
SVN revision: 42214
Automatically add \n to messages. Since we use that prefix, there is
no use to allow messages without \n, it would look a mess.
Some logging systems may not require the trailing newline, for example
logging to xml or syslog, for those you don't need to ignore this char
if present.
Yes, this breaks convention, but better now than latter. And the
results are not so bad.
SVN revision: 42200
eina_log_threads_enable() and then get thread safe logging with
non-main threads being printed with special notation to easily spot
those.
SVN revision: 42199
EINA_SAFETY_CHECKS will call eina_log, so calling these from inside
eina_log_print() may lead to recursion, that is really bad (although
it seems it would never lead to infinite recursion).
handle d->deleted, also showing error.
SVN revision: 42198