From cea21370a40d8b9ace858c477d5cedf214cdf520 Mon Sep 17 00:00:00 2001 From: "qiuyiuestc@gmail.com" Date: Mon, 4 Jul 2011 23:48:07 +0000 Subject: rewrite module memory allocator git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1618 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- include/rtdef.h | 4 ++-- include/rtthread.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/rtdef.h b/include/rtdef.h index e1dddcdcc2..2b60914e46 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -759,8 +759,8 @@ struct rt_module /* module memory allocator */ void* mem_list; /**< module's free memory list */ - rt_list_t page_list; /**< module's using page list */ - rt_mp_t mpool; /**< module's memory pool */ + void* page_array; /**< module's using pages */ + rt_uint32_t page_cnt; /**< module's using pages count */ rt_uint32_t nsym; /**< number of symbol in the module */ struct rt_module_symtab *symtab; /**< module symbol table */ diff --git a/include/rtthread.h b/include/rtthread.h index c3bc0516b5..27c6c97b7d 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -317,6 +317,12 @@ void rt_module_free(rt_module_t module, void *addr); rt_module_t rt_module_self (void); rt_err_t rt_module_set (rt_module_t module); rt_module_t rt_module_find(const char* name); + +#ifdef RT_USING_HOOK +void rt_module_load_sethook(void (*hook)(rt_module_t module)); +void rt_module_unload_sethook(void (*hook)(rt_module_t module)); +#endif + #endif /*@}*/ -- cgit v1.3.1