mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-13 06:55:31 +08:00
Added memory heap object implementation; Added RT_LIST_OBJECT_INIT macro.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2046 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
#define RT_DEBUG_MEM 0
|
||||
#endif
|
||||
|
||||
#ifndef RT_DEBUG_MEMHEAP
|
||||
#define RT_DEBUG_MEMHEAP 0
|
||||
#endif
|
||||
|
||||
#ifndef RT_DEBUG_MODULE
|
||||
#define RT_DEBUG_MODULE 0
|
||||
#endif
|
||||
|
||||
+258
-220
File diff suppressed because it is too large
Load Diff
+107
-102
File diff suppressed because it is too large
Load Diff
@@ -207,6 +207,18 @@ void rt_free_sethook(void (*hook)(void *ptr));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_MEMHEAP
|
||||
/**
|
||||
* memory heap object interface
|
||||
*/
|
||||
rt_err_t rt_memheap_init(struct rt_memheap* memheap, const char* name,
|
||||
void *start_addr, rt_uint32_t size);
|
||||
rt_err_t rt_memheap_detach(struct rt_memheap* heap);
|
||||
void* rt_memheap_alloc(struct rt_memheap *heap, rt_uint32_t size);
|
||||
void rt_memheap_free(void* ptr);
|
||||
|
||||
#endif
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
|
||||
+296
File diff suppressed because it is too large
Load Diff
@@ -46,6 +46,10 @@ struct rt_object_information rt_object_container[RT_Object_Class_Unknown] =
|
||||
/* initialize object container - message queue */
|
||||
{RT_Object_Class_MessageQueue, _OBJ_CONTAINER_LIST_INIT(RT_Object_Class_MessageQueue), sizeof(struct rt_messagequeue)},
|
||||
#endif
|
||||
#ifdef RT_USING_MEMHEAP
|
||||
/* initialize object container - memory heap */
|
||||
{RT_Object_Class_MemHeap, _OBJ_CONTAINER_LIST_INIT(RT_Object_Class_MemHeap), sizeof(struct rt_memheap)},
|
||||
#endif
|
||||
#ifdef RT_USING_MEMPOOL
|
||||
/* initialize object container - memory pool */
|
||||
{RT_Object_Class_MemPool, _OBJ_CONTAINER_LIST_INIT(RT_Object_Class_MemPool), sizeof(struct rt_mempool)},
|
||||
|
||||
Reference in New Issue
Block a user