Commit Graph

65 Commits

Author SHA1 Message Date
Mike Blumenkrantz c09c5ed690 and these
SVN revision: 50961
2010-08-10 12:05:51 +00:00
Mike Blumenkrantz 5b4ec5bd35 change EINA_ARRAY_THREADSAFE_ITER_RETURN to EINA_ARRAY_THREADSAFE_ITER_ESCAPE to match forthcoming threadsafe list api
SVN revision: 50956
2010-08-10 07:48:00 +00:00
Mike Blumenkrantz 56a0bd9396 implement threadsafety for arrays, alter all eina internal array usage to (hopefully) be threadsafe
call eina_threads_init() to enable this if you have pthread rwlock support (posix 2001)
note some function prototypes have lost const on array params to allow locking
WARNING: you should NOT call eina_threads_shutdown unless you are positive that you will not use any arrays which were created while threadsafe mode were enabled, and vice versa.  Failing to adhere to this warning WILL result in either deadlocks or memory leaks.


SVN revision: 50951
2010-08-10 03:26:15 +00:00
Carsten Haitzler 15c71af0a5 fix formatting also
SVN revision: 50577
2010-07-28 03:03:25 +00:00
Carsten Haitzler bed21c315d errrr... hmmm why did this change?
SVN revision: 50574
2010-07-28 02:48:11 +00:00
Carsten Haitzler ddc6ba2c2a uncrustify eina.
SVN revision: 50573
2010-07-28 02:37:05 +00:00
Vincent Torri 9c210617f7 declare variables at the beginning of the block
SVN revision: 49254
2010-05-28 19:04:44 +00:00
Vincent Torri 8126debb06 fix most compilation errors with vc++ (there are still a
problem with eina_log and output of the log messages:
STDERR_FILENO, STDOUT_FILENO and isatty())

fix some warnings and header files inclusion

update vcproj files


SVN revision: 47384
2010-03-23 06:41:17 +00:00
Gustavo Sverzut Barbieri c52d867527 delete trailing whitespace.
SVN revision: 46002
2010-02-09 03:00:47 +00:00
Carsten Haitzler 735ad48c39 eina - does modules like the rest of efl, so it's able to be installed with
multiple versions at the same time. eventually will neeed to also include
major number in release name too.



SVN revision: 45594
2010-01-26 15:54:28 +00:00
Cedric BAIL a9a3813966 * eina: Allow compilation with -Wshadow.
Patch from Albin Tonerre.


SVN revision: 45497
2010-01-23 19:53:27 +00:00
Vincent Torri 52fa8ddd47 get the shared library extension name from the autotools, as
it is more portable


SVN revision: 45229
2010-01-16 16:46:39 +00:00
Vincent Torri e2a2448461 basename() can modify its argument, so get a copy first
SVN revision: 45228
2010-01-16 16:41:24 +00:00
Jorge Luis Zapata Muga f3fb3dea17 + [Eina] API change. eina_module_list_flush() -> eina_module_list_free()
as we are on the modules context not the array.
  All the referenced projects are changed too. Remember that the list_free()
  already calls the unload() on each module so no need to call list_unload()



SVN revision: 44978
2010-01-08 12:22:23 +00:00
Vincent Torri 09d1853ea0 * finish benchmark tutorial
* move internal _init and _shutdown functions in the Global
   part of the code, as it is where they belong
 * fix minor documentation stuff


SVN revision: 44730
2009-12-27 08:45:30 +00:00
Gustavo Sverzut Barbieri 4e817e8ecd eina_module: more constness.
Thanks to Fabiano Fidencio for spotting those.



SVN revision: 43921
2009-11-23 13:24:48 +00:00
Gustavo Sverzut Barbieri d2fd0b36e0 eina_module_find: constness and gcc attribute.
Mark both array and module as const as we'll not modify them anyhow
inside this function.

Also mark this function as pure, so gcc will know how to optimize
multiple calls of it. Not that important for this function, but
doesn't hurt either.



SVN revision: 43918
2009-11-23 13:20:34 +00:00
Cedric BAIL ffb0bf8830 * eina_module: Add eina_module_find. Thanks to Fabiano Fidêncio <fidencio@profusion.mobi>.
SVN revision: 43847
2009-11-20 20:46:24 +00:00
Carsten Haitzler ca7859168b shh warning
SVN revision: 43257
2009-10-25 08:45:36 +00:00
Gustavo Sverzut Barbieri 8318f4c1f2 allow amalgamation of files, at least symbols don't clash anymore.
more related to amalgamation later.



SVN revision: 42312
2009-09-07 04:23:05 +00:00
Gustavo Sverzut Barbieri a4bd77905d malloc--: error and magic can take statically defined strings so no
need to strdup them.



SVN revision: 42311
2009-09-07 03:32:22 +00:00
Gustavo Sverzut Barbieri e4af7c100c EINA API BREAK: no more individual modules init/shutdown.
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
2009-09-06 22:21:56 +00:00
Vincent Torri e780763aa0 shutdown array module
SVN revision: 42287
2009-09-06 08:39:04 +00:00
Gustavo Sverzut Barbieri 5ea9ceeafc eina_module must initialize eina_array as it is used.
SVN revision: 42227
2009-09-04 02:34:48 +00:00
Gustavo Sverzut Barbieri 07d2bde900 eina_safety_checks_init()
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
2009-09-04 00:53:19 +00:00
Gustavo Sverzut Barbieri cee03dcb3c eina_log: CONVENTION BREAK!!!! automatically adds \n
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
2009-09-03 01:39:45 +00:00
Gustavo Sverzut Barbieri bb717a3be5 less malloc and memory fragmentation.
not that important, but an easy improvement does not hurt.



SVN revision: 42195
2009-09-02 23:11:22 +00:00
Gustavo Sverzut Barbieri 2f8ded1037 loggify eina_module, adding couple of debug info.
SVN revision: 42194
2009-09-02 23:06:55 +00:00
Gustavo Sverzut Barbieri c1e2a300e4 coding style/indent.
SVN revision: 42193
2009-09-02 22:39:41 +00:00
Vincent Torri 72b87160a2 * add eina_config.h in all source files. Fix linking with Visual Studio
* move eina_private.h and eina_safety_checks.h just after eina_config.h


SVN revision: 42077
2009-08-28 12:03:34 +00:00
Vincent Torri 6e7aecc7c0 * Put definition of alloca before any standard header
files according to the doc
 * define _GNU_SOURCE before the inclusion of alloca
   as features.h inclued by alloca.h, defines some
   macros according to _GNU_SOURCE.



SVN revision: 41940
2009-08-23 09:18:14 +00:00
Vincent Torri 989ade86dd fix a bit the documentation
SVN revision: 41870
2009-08-19 07:54:13 +00:00
Cedric BAIL b02de756a6 * eina: Rename eina_module_list_delete to eina_module_list_flush.
SVN revision: 41385
2009-07-17 11:13:38 +00:00
Vincent Torri 7a3b2110bf * more doc
* check the returned value of eina_error_init() in eina_module_init()


SVN revision: 41218
2009-06-28 06:29:11 +00:00
Vincent Torri ebc20c2236 API BREAK: fix Eina API so that it is more consistent with the other EFL
what is modified:

eina_counter_add -> eina_counter_new
eina_counter_delete -> eina_counter_free
eina_lalloc_delete -> eina_lalloc_free
eina_mempool_new -> eina_mempool_add
eina_mempool_delete -> eina_mempool_del
eina_mempool_alloc -> eina_mempool_malloc
eina_tiler_del -> eina_tiler_free

It remains some questions: have the following API a good name:

eina_module_list_delete
eina_list_free
eina_rbtree_delete

(see ticket #286)

If you find any problem, please report in that thread


SVN revision: 41187
2009-06-24 16:56:49 +00:00
Vincent Torri 9110d8d574 fix a bit the documentation, but there are still
a lot of doc to write...


SVN revision: 41164
2009-06-22 20:03:58 +00:00
Lars Munch 7bcbe02a3e Use correct module extension on cygwin
Patch from: booleanlabel at gmail dot com. Thanks.



SVN revision: 41094
2009-06-18 04:06:34 +00:00
Gustavo Sverzut Barbieri 32ff1f0aa4 better error setting and reporting in module loading.
* just set error codes if we know the error.
 * debug dlopen() error using EINA_ERROR_PDBG()



SVN revision: 41057
2009-06-16 14:59:09 +00:00
Gustavo Sverzut Barbieri df58840124 do not leak module if user do not want it.
SVN revision: 40924
2009-06-06 22:53:03 +00:00
Cedric BAIL a98287fc07 * eina/src/lib/eina_module.c: After deleting all members, we should flush the array.
SVN revision: 39057
2009-02-17 12:58:09 +00:00
Vincent Torri c166854ae1 * minor formatting
* add some doc in eina_array
 * in eina_main.c, include only the necessary headers
 * fix some warnings (size_t <-> int)


SVN revision: 38740
2009-01-23 16:11:45 +00:00
Vincent Torri 7554db7669 too much alloca declarations :-)
SVN revision: 38665
2009-01-20 16:14:36 +00:00
Cedric BAIL 0dda30daf6 * eina/src/include/eina_array.h,
* eina/src/include/eina_f16p16.h,
	* eina/src/include/eina_accessor.h,
	* eina/src/include/eina_list.h,
	* eina/src/include/eina_iterator.h,
	* eina/src/lib/eina_rectangle.c,
	* eina/src/lib/eina_list.c,
	* eina/src/lib/eina_array.c,
	* eina/src/lib/eina_hash.c,
	* eina/src/lib/eina_module.c,
	* eina/src/lib/eina_stringshare.c,
	* eina/src/lib/eina_benchmark.c: Fix for windows compilation.



SVN revision: 38663
2009-01-20 15:56:48 +00:00
Vincent Torri 0d166092ac * fix warning (missing alloca declaration)
* formatting


SVN revision: 38657
2009-01-20 08:29:41 +00:00
Cedric BAIL f722173009 Don't display useless warning.
SVN revision: 38346
2008-12-29 11:49:35 +00:00
Cedric BAIL 73c686a5ea Fix a little mistake.
SVN revision: 38339
2008-12-29 08:53:19 +00:00
Gustavo Sverzut Barbieri ab95d9183d eina safety checks.
safety checks will report null pointers and other error conditions on
public api's and can be disabled by compile time check.

note that in order to have these checks working we need to make
EINA_ARG_NONNULL() void, otherwise GCC can remove these checks since
they're known to be false.

This commit also make two minor changes:

  * list and hash accessors and iterators are created even for empty
    entities. This is correct in my point of view since NULL should
    indicate error. Having these in were an optimziation, but not
    worth it, these are not the most common case and hitting this path
    is not of much cost.

 * unmarked some parameters as nonnull, mainly on list and inlist.



SVN revision: 38327
2008-12-26 18:31:14 +00:00
Cedric BAIL 889d40abf8 Remove PATH_MAX use.
SVN revision: 38288
2008-12-23 13:12:06 +00:00
Cedric BAIL 437c220266 Add dladdr and env code for eina_module from Vincent Torri.
SVN revision: 37374
2008-11-01 15:39:53 +00:00
Cedric BAIL 4bb02bdf37 Add more error information during eina module load.
SVN revision: 36955
2008-10-22 08:56:19 +00:00