Give more choice to eina_list mempool.

SVN revision: 36479
This commit is contained in:
Cedric BAIL 2008-10-06 14:47:09 +00:00
parent b158ab48ed
commit 195b2da188
3 changed files with 39 additions and 2 deletions

View File

@ -62,6 +62,27 @@ if test "x${enable_magic_debug}" = "xyes" ; then
fi
AC_SUBST(EINA_MAGIC_DEBUG)
# Choose best memory pool
AC_ARG_ENABLE([default-mempool],
[AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer])],
[
if test "x${enableval}" = "xyes"; then
enable_default_mempool="yes"
else
enable_default_mempool="no"
fi
],
[enable_default_mempool="no"]
)
AC_MSG_CHECKING([whether to use default mempool allocator])
AC_MSG_RESULT([${enable_default_mempool}])
EINA_DEFAULT_MEMPOOL=0
if test "x${enable_default_mempool}" = "xyes" ; then
EINA_DEFAULT_MEMPOOL=1
fi
AC_SUBST(EINA_DEFAULT_MEMPOOL)
# Ememoa memory pool
AC_ARG_ENABLE([ememoa],
@ -322,6 +343,8 @@ echo " Thread Support.......: ${have_pthread}"
echo
echo " Magic debug..........: ${enable_magic_debug}"
echo
echo " Default mempool......: ${enable_default_mempool}"
echo
echo " Memory pool:"
echo " Ememoa.............: ${enable_ememoa}"
echo

View File

@ -24,4 +24,9 @@
#define EINA_MAGIC_DEBUG
#endif
#undef EINA_DEFAULT_MEMPOOL
#if @EINA_DEFAULT_MEMPOOL@
#define EINA_DEFAULT_MEMPOOL
#endif
#endif /* EINA_CONFIG_H_ */

View File

@ -407,15 +407,24 @@ eina_list_sort_merge(Eina_List *a, Eina_List *b, Eina_Compare_Cb func)
EAPI int
eina_list_init(void)
{
char *choice;
if (!_eina_list_init_count)
{
eina_error_init();
eina_magic_string_init();
eina_mempool_init();
_eina_list_mp = eina_mempool_new("chained_mempool", "list", NULL,
#ifdef EINA_DEFAULT_MEMPOOL
choice = "pass_through";
#else
if (!(choice = getenv("EINA_MEMPOOL")))
choice = "chained_mempool";
#endif
_eina_list_mp = eina_mempool_new(choice, "list", NULL,
sizeof (Eina_List), 320);
_eina_list_accounting_mp = eina_mempool_new("chained_mempool", "list_accounting", NULL,
_eina_list_accounting_mp = eina_mempool_new(choice, "list_accounting", NULL,
sizeof (Eina_List_Accounting), 80);
eina_magic_string_set(EINA_MAGIC_ITERATOR,