diff options
| author | qiuyiuestc <[email protected]> | 2010-10-28 01:21:47 +0000 |
|---|---|---|
| committer | qiuyiuestc <[email protected]> | 2010-10-28 01:21:47 +0000 |
| commit | fb7d4122fc97be364cf2ce76380b0e5465aba7eb (patch) | |
| tree | 5149aa8116873baaeb7b8e9cb7160a5011aa10bd /src/mempool.c | |
| parent | a6f06d24cfec32dddee27a1ce61920fc4007d68a (diff) | |
implement module memory allocator
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1030 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src/mempool.c')
| -rw-r--r-- | src/mempool.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mempool.c b/src/mempool.c index 53f1162802..5d91118604 100644 --- a/src/mempool.c +++ b/src/mempool.c @@ -15,6 +15,7 @@ * 2006-08-04 Bernard add hook support * 2006-08-10 Bernard fix interrupt bug in rt_mp_alloc * 2010-07-13 Bernard fix RT_ALIGN issue found by kuronca + * 2010-10-26 yi.qiu add module support in rt_mp_delete */ #include <rthw.h> @@ -252,6 +253,13 @@ rt_err_t rt_mp_delete(rt_mp_t mp) rt_hw_interrupt_enable(temp); } +#ifdef RT_USING_MODULE + /* the mp object belongs to an application module */ + if(mp->parent.flag & RT_OBJECT_FLAG_MODULE) + rt_module_free(mp->parent.module_id, mp->start_address); + else +#endif + /* release allocated room */ rt_free(mp->start_address); |
