summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2017-12-12 07:36:37 +0800
committerBernard Xiong <[email protected]>2017-12-12 07:36:37 +0800
commit2f409c85f1faf3662c9ee99eed78e460286ec046 (patch)
tree8cb7d40433fa873576a75bca6a45d3456eb6893e /src
parent5ec1046ca9dd63078a154401553d96aa8ae1933f (diff)
[Kernel] Use rt_object_get_information to get object chain
Diffstat (limited to 'src')
-rw-r--r--src/memheap.c4
-rw-r--r--src/thread.c5
2 files changed, 4 insertions, 5 deletions
diff --git a/src/memheap.c b/src/memheap.c
index 8b7588a068..dcd9114620 100644
--- a/src/memheap.c
+++ b/src/memheap.c
@@ -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)
diff --git a/src/thread.c b/src/thread.c
index c39d689e0f..3a3e55302e 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -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)