diff options
| author | Gabriel Wang <[email protected]> | 2022-01-07 23:35:44 +0000 |
|---|---|---|
| committer | Gabriel Wang <[email protected]> | 2022-01-07 23:35:44 +0000 |
| commit | d7b8cf81e6285f3cbb0817cbe79c527f10ff56b7 (patch) | |
| tree | 3e47ead2e339c0f1181c9ca2f4ffbfec9536d7eb /src/mempool.c | |
| parent | 495e209f379338b2bbc4ba086e457d0fb6d22a8d (diff) | |
move some __on_rt_xxxxx_hook from rtdef.h to dedicated c soure files
Diffstat (limited to 'src/mempool.c')
| -rw-r--r-- | src/mempool.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mempool.c b/src/mempool.c index 09a4955eee..ea0ea94cfa 100644 --- a/src/mempool.c +++ b/src/mempool.c @@ -14,6 +14,7 @@ * 2010-10-26 yi.qiu add module support in rt_mp_delete * 2011-01-24 Bernard add object allocation check. * 2012-03-22 Bernard fix align issue in rt_mp_init and rt_mp_create. + * 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to mempool.c */ #include <rthw.h> @@ -21,7 +22,14 @@ #ifdef RT_USING_MEMPOOL -#ifdef RT_USING_HOOK +#ifndef __on_rt_mp_alloc_hook + #define __on_rt_mp_alloc_hook(mp, block) __ON_HOOK_ARGS(rt_mp_alloc_hook, (mp, block)) +#endif +#ifndef __on_rt_mp_free_hook + #define __on_rt_mp_free_hook(mp, block) __ON_HOOK_ARGS(rt_mp_free_hook, (mp, block)) +#endif + +#if defined(RT_USING_HOOK) && defined(RT_HOOK_USING_FUNC_PTR) static void (*rt_mp_alloc_hook)(struct rt_mempool *mp, void *block); static void (*rt_mp_free_hook)(struct rt_mempool *mp, void *block); |
