summaryrefslogtreecommitdiff
path: root/src/idle.c
diff options
context:
space:
mode:
author[email protected] <[email protected]>2011-07-04 23:48:07 +0000
committer[email protected] <[email protected]>2011-07-04 23:48:07 +0000
commitcea21370a40d8b9ace858c477d5cedf214cdf520 (patch)
tree8144ca112fbc77be725326182d0dcb3d530c55f3 /src/idle.c
parent3bc0dd4a825f80a0e56d8a92e633a06435f1ac40 (diff)
rewrite module memory allocator
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1618 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src/idle.c')
-rw-r--r--src/idle.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/idle.c b/src/idle.c
index cae3f34f1a..7bda4dc69b 100644
--- a/src/idle.c
+++ b/src/idle.c
@@ -115,7 +115,7 @@ void rt_thread_idle_excute(void)
rt_hw_interrupt_enable(lock);
#ifdef RT_USING_HEAP
-#ifdef RT_USING_MODULE
+#if defined(RT_USING_MODULE) && defined(RT_USING_SLAB)
/* the thread belongs to an application module */
if(thread->flags & RT_OBJECT_FLAG_MODULE)
rt_module_free((rt_module_t)thread->module_id, thread->stack_addr);
@@ -125,6 +125,7 @@ void rt_thread_idle_excute(void)
rt_free(thread->stack_addr);
/* delete thread object */
rt_object_delete((rt_object_t)thread);
+#endif
#ifdef RT_USING_MODULE
if(module != RT_NULL)
@@ -138,8 +139,7 @@ void rt_thread_idle_excute(void)
}
/* unload module */
- if(module->nref == 0) rt_module_unload(module);
-#endif
+ if(module->nref == 0) rt_module_unload(module);
#endif
}
}