Add a pass through mempool.

SVN revision: 35408
This commit is contained in:
Cedric BAIL 2008-08-08 14:26:59 +00:00
parent 6eacc6aa2d
commit 5c20f9cda0
5 changed files with 98 additions and 1 deletions

View File

@ -194,6 +194,7 @@ src/modules/Makefile
src/modules/mp/Makefile
src/modules/mp/chained_pool/Makefile
src/modules/mp/ememoa_fixed/Makefile
src/modules/mp/pass_through/Makefile
src/tests/Makefile
])

View File

@ -1,4 +1,4 @@
SUBDIRS = chained_pool ememoa_fixed
SUBDIRS = chained_pool ememoa_fixed pass_through
MAINTAINERCLEANFILES = \
Makefile.in

View File

@ -0,0 +1,7 @@
Makefile.in
Makefile
*.la
*.lo
*.gcno
.libs
.deps

View File

@ -0,0 +1,19 @@
MAINTAINERCLEANFILES = \
Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/include \
@COVERAGE_CFLAGS@ \
@EMEMOA_CFLAGS@
controllerdir = $(libdir)/eina/pass_through/
controller_LTLIBRARIES = pass_through.la
pass_through_la_SOURCES = \
pass_through.c
pass_through_la_LIBADD = $(top_builddir)/src/lib/libeina.la @COVERAGE_LIBS@
pass_through_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
pass_through_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la

View File

@ -0,0 +1,70 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
/* EINA - EFL data type library
* Copyright (C) 2008 Cedric BAIL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include "eina_types.h"
#include "eina_private.h"
static void *
eina_pass_through_malloc(__UNUSED__ void *data, unsigned int size)
{
return malloc(size);
}
static void
eina_pass_through_free(__UNUSED__ void *data, void *ptr)
{
free(ptr);
}
static void*
eina_pass_through_realloc(__UNUSED__ void *data, void *ptr, unsigned int size)
{
return realloc(ptr, size);
}
static void*
eina_pass_through_init(__UNUSED__ const char *context, __UNUSED__ const char *option, __UNUSED__ va_list args)
{
return NULL;
}
static void
eina_pass_through_shutdown(__UNUSED__ void *data)
{
}
Eina_Mempool_Backend mp_backend = {
.init = &eina_pass_through_init,
.shutdown = &eina_pass_through_shutdown,
.realloc = &eina_pass_through_realloc,
.alloc = &eina_pass_through_malloc,
.free = &eina_pass_through_free,
.garbage_collect = NULL,
.statistics = NULL
};