diff --git a/include/rtdef.h b/include/rtdef.h index dbc0db3b17..67fda14610 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -224,9 +224,11 @@ typedef struct rt_object *rt_object_t; /* Type for kernel objec * - Event * - MailBox * - MessageQueue + * - MemHeap * - MemPool * - Device * - Timer + * - Module * - Unknown * - Static */ diff --git a/src/module.c b/src/module.c index 19771137a5..71929b4462 100644 --- a/src/module.c +++ b/src/module.c @@ -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; #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 /* initialize object container - memory pool */ rt_list_init(&(module->module_object[RT_Object_Class_MemPool].object_list)); diff --git a/src/rtm.c b/src/rtm.c index d94c0e30ec..38d6df3d30 100644 --- a/src/rtm.c +++ b/src/rtm.c @@ -110,6 +110,16 @@ RTM_EXPORT(rt_mq_recv); RTM_EXPORT(rt_mq_control); #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 /* * memory pool interface symbol