Commit Graph

36 Commits

Author SHA1 Message Date
Carsten Haitzler b7d882515d eina mempool: don't allow 0 sized mempools
there is no point in having a mempool with a max 0 size. this leads to
us mallocing 0 bytes for the base. not good. make minimim size 1. :)

@fix
2016-04-18 09:31:08 +09:00
Daniel Kolesa 03bce14908 eina mp: also include malloc_np.h on FreeBSD 2016-01-07 15:43:26 +00:00
Daniel Kolesa dadc350507 eina mp: only include malloc.h on linux
Elsewhere, everything is in stdlib.h.

@fix
2016-01-07 15:31:59 +00:00
Subodh Kumar 554b2cd9da eina: minimize fragmentation of chainned mempool.
Summary:
Previously: Each allocation happened in the first chain after any free.
Now: All allocation will happen in one chain until all buckets are full, this can reduce
fragmentation to some extent.

Reviewers: seoz, govi, shilpasingh, raster, cedric

Reviewed By: cedric

Subscribers: cedric, rajeshps

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-06 20:19:20 +01:00
Cedric BAIL 938aba36eb eina: do not access dead pointer from within valgrind macro. 2014-01-22 12:22:13 +09:00
Gustavo Sverzut Barbieri dbc4669d68 eina/mp/one_big: fix alignment issues.
When over-allocating (past "pool->max" items) a memory slice will be
allocated to the new item as a linked list using Eina_Inlist.

The original code was placing the Eina_Inlist structure (3 pointers)
at the beginning of the allocated memory. However the item must have
proper alignment based on "pool->item_size", otherwise a structure may
end with unaligned members. Take for example MIPS 32 bits, it uses 4
bytes pointers with 8 bytes double. A structure containing a double
could have it unaligned as 12 % 8 = 4 (12 is the size of Eina_Inlist,
that contains 3 pointers), and MIPS doesn't allow unaligned access.

Albin Tonnerre (Lutin) spotted this in his Debian MIPS test machine,
it was breaking at eet_data_get_double() that was storing an unaligned
double. This was being called from within edje test suite.

The current code will place the list node after the requested
"pool->item_size", of course guaranteeing the pointer inside the node
is aligned (otherwise a "char" or "short" would break its alignment).
2014-01-20 21:44:42 -02:00
Cedric BAIL 1027e7d59c eina: avoid warning. 2013-11-10 12:07:59 +01:00
Cedric BAIL da559ee5d0 eina: use portable infrastructure to detect page size. 2013-11-10 09:26:12 +01:00
Stefan Schmidt ac89c082a4 Revert "Revert "eina: use Eina_Spinlock for Eina_Chained_Mempool.""
Revert now that it is fixed in eina.

This reverts commit 875e7cf74d.
2013-10-11 09:42:49 +01:00
Stefan Schmidt ab0f7ca625 Revert "Revert "Revert "eina: use Eina_Spinlock for Eina_Chained_Mempool."""
Is there a title for the commiter with the longest revert of a revert list?

I screwed this one up. Had other local changes that sneaked in.
Resetting and doing it right now.

This reverts commit ee155b771d.
2013-10-11 09:41:22 +01:00
Stefan Schmidt ee155b771d Revert "Revert "eina: use Eina_Spinlock for Eina_Chained_Mempool.""
You can bet on reverting makes people speed up the process in fixing it.
Revert the revert here now that Cedric fixed it in eina.

This reverts commit 875e7cf74d.
2013-10-11 09:36:35 +01:00
Stefan Schmidt 875e7cf74d Revert "eina: use Eina_Spinlock for Eina_Chained_Mempool."
This patch brings in constant E crash for me. It seems to be timing
related which somehow leads to a mem corruption. Revert it for now
to allow people using E while Cedric looks into it.

This reverts commit 12d34309c7.
2013-10-11 09:18:10 +01:00
Carsten Haitzler 69e27abdc3 eina - and e3fl in general - stop using eina_error_get/set - useless really 2013-10-11 16:50:40 +09:00
Cedric Bail 12d34309c7 eina: use Eina_Spinlock for Eina_Chained_Mempool. 2013-10-11 11:08:17 +09:00
Stefan Schmidt 64c7bd14df eina/mp/one_big: Add a comment to clarify why we do not memset the complete memory.
To avoid people getting confused over this code, like myself, add a comment
to clarify that only the elements need to be set to zero while the payload
does not matter here.
2013-06-14 09:56:55 +01:00
Jérémy Zurcher 1d3fd66860 eina_chained_mempool: typo 2013-06-12 23:34:40 +02:00
Jérémy Zurcher efe5fbb780 eina_chained_mempool: fix ERR arg format 2013-06-12 23:34:40 +02:00
Cedric Bail fa8c469453 eina: align allocated memory to 4096. 2013-04-04 23:50:14 +09:00
Tom Hacohen a35b034b7c Eina mempool: Fixed compilation warning. 2013-03-08 11:46:41 +00:00
Cedric BAIL ab12337d76 eina: forgotten include that borked debug build. 2013-03-04 13:51:26 +09:00
Cedric BAIL 7636dc88c4 eina: try to fix debug build typo.
SVN revision: 83315
2013-01-25 01:20:58 +00:00
Cedric BAIL 5d335bb50b efl/eina: it's really an error, thanks Ulisses.
SVN revision: 83198
2013-01-24 03:54:47 +00:00
Cedric BAIL efa613597d efl/eina: one more typo.
SVN revision: 83197
2013-01-24 03:04:05 +00:00
Cedric BAIL eff597ea1e eina: fix some warning.
SVN revision: 83196
2013-01-24 02:58:00 +00:00
Cedric BAIL b1d856bc8b efl/eina: detect when freeing pointer inside an allocated memory.
SVN revision: 83195
2013-01-24 02:44:14 +00:00
Cedric BAIL 3cfd345a91 efl/eina: simplify mempool logic.
SVN revision: 83194
2013-01-24 02:23:59 +00:00
Gustavo Sverzut Barbieri 4668d04f04 efl: cleanup HAVE_THREADS and pthread usage outside of eina.
Eina now abstracts threads, so use that.

the touched files had the EFL_HAVE_THREADS as it's mandatory now.



SVN revision: 81935
2012-12-31 16:14:40 +00:00
Vincent Torri 58a9a0ad57 merge: don't use recursive subdirs. Compilation should be faster.
Please check.

note1: Only lib and bin for now, but should be extended to other stuff
note2: distcheck does not work because eo_suite is failing.


SVN revision: 78758
2012-11-01 12:56:52 +00:00
Vincent Torri aac3e95ccf merge: -Wl,--enable-auto-import is useless with recent versions of gcc on Windows
SVN revision: 78495
2012-10-25 22:01:28 +00:00
Vincent Torri 77d90bd45e merge: pass directly to the preprocessor the Windows macro instead of using autotools
SVN revision: 78350
2012-10-23 05:43:57 +00:00
Gustavo Sverzut Barbieri 67a8770fac efl: remove duplicate paths due header move.
eina headers used to be in their own directory, but now they live
inside src/lib/eina. The mempools were still including
include/lib/eina/ and with "sed" they became src/lib/eina/, which
already existed.



SVN revision: 77837
2012-10-10 22:51:18 +00:00
Gustavo Sverzut Barbieri c432e72582 efl: unify EFL_DEBUG_THREADS and EINA_HAVE_DEBUG_THREADS
SVN revision: 77821
2012-10-10 21:48:34 +00:00
Gustavo Sverzut Barbieri 4d35e4ca03 efl: simplify mempools, nuke some and make remaining statically built.
Now we always build the following memory pools statically:
 - pass_through: calls malloc/free directly, useful to debug.
 - chained_pool: default for ages.
 - one_big: used by some embedded systems (should we remove?)

Removed:
 - ememoa_fixed and ememoa_unknown: depends on a separate lib, not supported?
 - buddy: nobody uses it?

NOTE: we do not need the src/modules/eina/mp/*/Makefile.am anymore
since they are statically built. But I'll keep these and the
references in src/modules/eina/mp/Makefile.am



SVN revision: 77792
2012-10-10 19:57:53 +00:00
Vincent Torri 7fe3d35994 merge: __UNUSED__ --> EINA_UNUSED and some fixes in eo.
SVN revision: 77542
2012-10-05 20:09:47 +00:00
Carsten Haitzler 156f4a783f and more include dir fixes.
SVN revision: 77122
2012-09-27 04:14:38 +00:00
Vincent Torri 785f2a6b3a merge : add eina
currently, examples, tests and benchmark are not set. That's the next things i'll do


SVN revision: 76710
2012-09-16 10:57:48 +00:00