1 /* EINA - EFL data type library
2 * Copyright (C) 2008 Cedric BAIL
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
25 #include "eina_types.h"
26 #include "eina_module.h"
27 #include "eina_mempool.h"
28 #include "eina_private.h"
31 eina_pass_through_malloc(__UNUSED__ void *data, unsigned int size)
37 eina_pass_through_free(__UNUSED__ void *data, void *ptr)
43 eina_pass_through_realloc(__UNUSED__ void *data, void *ptr, unsigned int size)
45 return realloc(ptr, size);
49 eina_pass_through_init(__UNUSED__ const char *context,
50 __UNUSED__ const char *option,
51 __UNUSED__ va_list args)
57 eina_pass_through_shutdown(__UNUSED__ void *data)
62 static Eina_Mempool_Backend _eina_pass_through_mp_backend = {
64 &eina_pass_through_init,
65 &eina_pass_through_free,
66 &eina_pass_through_malloc,
67 &eina_pass_through_realloc,
70 &eina_pass_through_shutdown,
74 Eina_Bool pass_through_init(void)
76 return eina_mempool_register(&_eina_pass_through_mp_backend);
79 void pass_through_shutdown(void)
81 eina_mempool_unregister(&_eina_pass_through_mp_backend);
84 #ifndef EINA_STATIC_BUILD_PASS_THROUGH
86 EINA_MODULE_INIT(pass_through_init);
87 EINA_MODULE_SHUTDOWN(pass_through_shutdown);
89 #endif /* ! EINA_STATIC_BUILD_PASS_THROUGH */