add memory heap object in module

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2113 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
dzzxzz@gmail.com 2012-05-07 06:23:30 +00:00
parent b14044212b
commit 1641c9db4f
3 changed files with 19 additions and 0 deletions

View File

@ -224,9 +224,11 @@ typedef struct rt_object *rt_object_t; /* Type for kernel objec
* - Event * - Event
* - MailBox * - MailBox
* - MessageQueue * - MessageQueue
* - MemHeap
* - MemPool * - MemPool
* - Device * - Device
* - Timer * - Timer
* - Module
* - Unknown * - Unknown
* - Static * - Static
*/ */

View File

@ -293,6 +293,13 @@ static void rt_module_init_object_container(struct rt_module *module)
module->module_object[RT_Object_Class_MessageQueue].type = RT_Object_Class_MessageQueue; module->module_object[RT_Object_Class_MessageQueue].type = RT_Object_Class_MessageQueue;
#endif #endif
#ifdef RT_USING_MEMHEAP
/* initialize object container - memory heap */
rt_list_init(&(module->module_object[RT_Object_Class_MemHeap].object_list));
module->module_object[RT_Object_Class_MemHeap].object_size = sizeof(struct rt_memheap);
module->module_object[RT_Object_Class_MemHeap].type = RT_Object_Class_MemHeap;
#endif
#ifdef RT_USING_MEMPOOL #ifdef RT_USING_MEMPOOL
/* initialize object container - memory pool */ /* initialize object container - memory pool */
rt_list_init(&(module->module_object[RT_Object_Class_MemPool].object_list)); rt_list_init(&(module->module_object[RT_Object_Class_MemPool].object_list));

View File

@ -110,6 +110,16 @@ RTM_EXPORT(rt_mq_recv);
RTM_EXPORT(rt_mq_control); RTM_EXPORT(rt_mq_control);
#endif #endif
#ifdef RT_USING_MEMHEAP
/*
* memory heap interface symbol
*/
RTM_EXPORT(rt_memheap_init);
RTM_EXPORT(rt_memheap_detach);
RTM_EXPORT(rt_memheap_alloc);
RTM_EXPORT(rt_memheap_free);
#endif
#ifdef RT_USING_MEMPOOL #ifdef RT_USING_MEMPOOL
/* /*
* memory pool interface symbol * memory pool interface symbol