mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 18:57:16 +08:00
[Kernel] Use rt_object_get_information to get object chain
This commit is contained in:
+2
-2
@@ -620,10 +620,10 @@ void *rt_malloc(rt_size_t size)
|
||||
struct rt_list_node *node;
|
||||
struct rt_memheap *heap;
|
||||
struct rt_object_information *information;
|
||||
extern struct rt_object_information rt_object_container[];
|
||||
|
||||
/* try to allocate on other memory heap */
|
||||
information = &rt_object_container[RT_Object_Class_MemHeap];
|
||||
information = rt_object_get_information(RT_Object_Class_MemHeap);
|
||||
RT_ASSERT(information != RT_NULL);
|
||||
for (node = information->object_list.next;
|
||||
node != &(information->object_list);
|
||||
node = node->next)
|
||||
|
||||
+2
-3
@@ -750,14 +750,13 @@ rt_thread_t rt_thread_find(char *name)
|
||||
struct rt_object *object;
|
||||
struct rt_list_node *node;
|
||||
|
||||
extern struct rt_object_information rt_object_container[];
|
||||
|
||||
/* enter critical */
|
||||
if (rt_thread_self() != RT_NULL)
|
||||
rt_enter_critical();
|
||||
|
||||
/* try to find device object */
|
||||
information = &rt_object_container[RT_Object_Class_Thread];
|
||||
information = rt_object_get_information(RT_Object_Class_Thread);
|
||||
RT_ASSERT(information != RT_NULL);
|
||||
for (node = information->object_list.next;
|
||||
node != &(information->object_list);
|
||||
node = node->next)
|
||||
|
||||
Reference in New Issue
Block a user