Commit Graph

132 Commits

Author SHA1 Message Date
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
Gustavo Sverzut Barbieri 643958705b eina_matrixsparse: welcome sparse matrix implementation and tests.
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
2009-09-04 13:43:44 +00:00
Gustavo Sverzut Barbieri 8ca1675c51 eina_error: deprecated old logging, move to eina_log.
SVN revision: 42220
2009-09-04 01:37:11 +00:00
Cedric BAIL 49cb141f10 * eina_magic: Test suite now work when magic debug is disabled.
SVN revision: 42150
2009-09-01 12:17:13 +00:00
dieb d7bbc05b12 Initial import of the new eina logging API.
* eina_error might be kept for error messages and codes, but it's logging API
  will be deprecated. For now, it's been kept for not breaking others code and
  for a smoother transition.
* Added test for new logging API, also demonstrates usage.


SVN revision: 41960
2009-08-24 21:43:48 +00:00
Gustavo Sverzut Barbieri 944be7e745 Bugfix eina_list_search_sorted_near_list() add sorted_insert.
eina_list_search_sorted_near_list() was broken and barfed at my face
during development of eina_list_sorted_insert(), so I rewrote it
following more traditional approach, also adding special cases for
head/tail remembering that random access in lists is not as fast as
array. I also simplified that code.

eina_list_sorted_insert() should be fast, O(log2 n) insert, with
special cases to insert already sorted arrays forwards or backwards,
however I believe that it's better to simply append/prepend in those
cases (if known).



SVN revision: 41625
2009-08-06 22:31:45 +00:00
Gustavo Sverzut Barbieri f86aa350c6 allow limit tests to run.
eina_suite TEST1 TEST2 ... is your friend ;-)



SVN revision: 41624
2009-08-06 22:22:56 +00:00
Gustavo Sverzut Barbieri 638e79b91e smarter eina_list_merge(), more tests.
eina_list_merge() now fixes the smallest list segment, not always the
right. Before if we joined a list 1 to 1000 segments we'd fix all the
1000 instead of the single at left.

Tests to make sure both code paths are being executed.



SVN revision: 41622
2009-08-06 18:35:53 +00:00
Gustavo Sverzut Barbieri 14105484aa Eina rectangle missing list init.
Rectangle needs the list module for the pool_new() function. Patch
also adds a check for initialization error on the unit test.

By: Andre Dieb


SVN revision: 41460
2009-07-21 01:55:31 +00:00
Gustavo Sverzut Barbieri 25ac55ae09 update rectangle test to new API.
Guys, when you change API, please change it everywhere and then run tests!

By: Andre Dieb


SVN revision: 41421
2009-07-18 15:58:44 +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 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
Cedric BAIL 3b384b323c * eina: Faster Eina_Rectangle_Pool (should be used by OpenGL engine).
SVN revision: 41185
2009-06-24 13:38:25 +00:00
Cedric BAIL 5c5cb1fdb1 * eina: Add a benchmark for eina_rectangle_pool.
SVN revision: 41157
2009-06-22 13:24:13 +00:00
Cedric BAIL 4fa66bcae9 * eina: Evas_Data are gone so unactivate benchmark.
SVN revision: 41156
2009-06-22 13:20:29 +00:00
Vincent Torri 045986b465 fix rectangle unit test
SVN revision: 40158
2009-04-18 09:17:37 +00:00
Carsten Haitzler 739db97356 1. cygwin fixes from booleanlabel@gmail.com
2. these are just generic fixes - so also fix 1 doc example too.



SVN revision: 39464
2009-03-13 10:53:07 +00:00
Cedric BAIL 3c2f745ab9 Fix wrong order and useless double include.
SVN revision: 38660
2009-01-20 15:40:36 +00:00
Gustavo Sverzut Barbieri b0ee5696a6 eina gets lots of gcc attributes to its api.
this should help with optimizations and code correctness, please see
"info gcc" for detailed explanation on these.

if you experience some functions not working as expected, please
double check if they're not marked with EINA_PURE or EINA_CONST, maybe
I misused them. Remove the macro and try again.

brief explanation:

 * EINA_WARN_UNUSED_RESULT: if you forgot to use the return of some
   function, it will emit a warning (and -Werror will make it an
   error). This way it will be harder to miss the attribution
   "l = eina_list_append(l, v)".

 * EINA_ARG_NONNULL(index, index...): if you give it an explicit NULL
   argument, or some tool (ie: clang) finds it could get a NULL but
   this is not accepted by API, then a warning will be emitted.  This
   will help those that still use eina_hash_add() as if it is
   evas_hash_add().

 * EINA_MALLOC: any non-NULL pointer it returns cannot alias any other
   pointer valid when function returns.

 * EINA_PURE: function have no effects other than the return and this
   return just depend on parameters and/or globals. You might call
   this function in a loop a thousand times and it will return the
   same value, thus you may move this function outside the loop and
   remove it.

 * EINA_CONST: stricter version of EINA_PURE, it will not check for
   global parameters, that is, you cannot consider pointer
   arguments. Use it for math things like "int sqrt(int)".

 * EINA_PRINTF(fmt, arg): will check format parameter specified in
   position "fmt" and passed arguments starting at position "arg", it
   will check for things like giving integers where short or strings
   were expected.

 * EINA_SCANF(fmt, arg): similar to eina_printf().

 * EINA_FORMAT(fmt): for use with things like dgettext(), it will get
   a printf-like format string and modifies it.

Please review and test it with your software, make sure you make clean
before you install the new version so it has any effect.

If you find some functions are missing EINA_WARN_UNUSED_RESULT and
EINA_ARG_NONNULL or others, please add them.



SVN revision: 38323
2008-12-26 13:17:51 +00:00
Cedric BAIL 68cfd7839f Add a visual feedback to counte test.
SVN revision: 38056
2008-12-09 13:58:04 +00:00
Cedric BAIL 24c1995b68 Change eina_counter_dump to return a string so it could work easily on windows.
SVN revision: 38055
2008-12-09 13:55:10 +00:00
Gustavo Sverzut Barbieri 091741f861 Force dummy_symbol to be visible.
"make check" was failing with -fvisibility=hidden.



SVN revision: 37958
2008-12-06 06:12:30 +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
Gustavo Sverzut Barbieri e9a398e076 test small strings.
SVN revision: 37280
2008-10-28 17:19:02 +00:00
Cedric BAIL a299da4fb5 This test is now not defined. Remove it.
SVN revision: 37277
2008-10-28 16:40:34 +00:00
Cedric BAIL e243e4408a Make Eina_Rectangle_Pool more usable.
SVN revision: 37275
2008-10-28 15:28:46 +00:00
Cedric BAIL 72e45419ec Add Eina_Rectangle_Pool support. Typically help for font handling in OpenGL or
any case where you need to split a rectangle in many differents small rectangle.


SVN revision: 37252
2008-10-27 20:24:12 +00:00
Cedric BAIL 68d377afe6 Rename EINA_INLIST_ITER_NEXT/EINA_INLIST_ITER_LAST to EINA_INLIST_FOREACH/
EINA_INLIST_REVERSE_FOREACH so it best match is behaviour. Asked by Gustavo.



SVN revision: 36928
2008-10-21 12:19:57 +00:00
Cedric BAIL 1950725606 Add merge function to list data type.
SVN revision: 36922
2008-10-21 11:28:38 +00:00
Cedric BAIL 380120ce2a Should fix build outside of the source tree.
SVN revision: 36689
2008-10-15 16:23:14 +00:00
Cedric BAIL d905ee9bda Add option to report stringshare usage (E17 use around 10000 differents strings).
SVN revision: 36658
2008-10-14 15:32:57 +00:00
Cedric BAIL d3ba8a9e2e Actually bench djb2 inline and not superfast hash function.
SVN revision: 36480
2008-10-06 14:48:13 +00:00
Cedric BAIL b158ab48ed Update hash benchmark to reflect E use (hash population under 2000, more find than add).
Current status :
 - same performance for evas, eina and glib with les than 500 items.
 - glib is then faster, eina/evas are second until 800.
 - glib remain the fastest, eina is second, and evas is starting to drop in performance.



SVN revision: 36476
2008-10-06 12:16:27 +00:00
Cedric BAIL 439401682d Reduce code size, and improve sort speed.
SVN revision: 36382
2008-10-01 16:30:30 +00:00
Cedric BAIL 9ef4d6b65d Benchmark glib mempool too.
SVN revision: 36360
2008-09-30 15:07:35 +00:00
Cedric BAIL 9ffada517d Faster sort initialisation.
SVN revision: 36359
2008-09-30 14:16:18 +00:00
Cedric BAIL 3315d29c7f Fix chained mempool allocator.
SVN revision: 36355
2008-09-30 12:55:33 +00:00
Vincent Torri f9a4c97693 add a config.h
SVN revision: 36342
2008-09-30 06:16:41 +00:00
Vincent Torri bf372e44f9 when a .la file is passed to _LIBADD or _LDADD, automake
knows that the corresponding program or lib depends on
that .la file


SVN revision: 36322
2008-09-29 19:30:15 +00:00
Vincent Torri e88e4d5fb5 * fix warning in tests
* add config.h when needed
 * remove result/ dir before launching benchmark


SVN revision: 36321
2008-09-29 19:20:16 +00:00
Cedric BAIL b6960f58b6 Patch from Vincent Torri that cleanup tests, coverage and benchmark.
SVN revision: 36315
2008-09-29 14:35:28 +00:00
Cedric BAIL 7c47066009 Change module API to use Eina_Array as we want to use mempool and module for Eina_List.
Fix at the same time a closing bug in eina_module.c.



SVN revision: 36312
2008-09-29 13:28:42 +00:00
Cedric BAIL 1620af2ae0 Add benchmark for mempool (chained_mempool is disabled, because it's currently buggy).
SVN revision: 36309
2008-09-29 09:45:26 +00:00
Cedric BAIL 93656a916a Fix initialization.
SVN revision: 36308
2008-09-29 09:43:37 +00:00
Vincent Torri d6ae9053ad minor formatting
SVN revision: 36293
2008-09-28 13:10:08 +00:00
Cedric BAIL 2acd11a39e Add a new type of memory pool and factorize test code.
SVN revision: 36267
2008-09-26 15:27:46 +00:00
Cedric BAIL 6f5b3584dd Store build information inside eina_config.h, and fix magic use.
SVN revision: 36263
2008-09-26 11:41:55 +00:00
Cedric BAIL 42d39725b4 Last part of quarium patch.
SVN revision: 36257
2008-09-25 14:46:48 +00:00
Cedric BAIL 8b85ce70d4 Patch from quarium.
Add magic to array and list.

Need to patch autotools to generate something like eina_config.h.



SVN revision: 36256
2008-09-25 14:46:16 +00:00
Cedric BAIL e8b25fb405 Add a sort benchmark.
SVN revision: 36250
2008-09-25 12:41:49 +00:00