summaryrefslogtreecommitdiff
path: root/src/mempool.c
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-07-13 07:36:37 +0000
committerbernard.xiong <[email protected]>2010-07-13 07:36:37 +0000
commit214e44c3f9d79e34719cd9cef5e2fc596a693d47 (patch)
tree5270f946a824b0d54689953aca65d6039ffaee3b /src/mempool.c
parent69466590ff78faa11ed508d74a5509113b8dace0 (diff)
fix down alignment issue; fix the maximal number of rt_scheduler_lock_nest issue; fix rt_tick_from_millisecond issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@790 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src/mempool.c')
-rw-r--r--src/mempool.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mempool.c b/src/mempool.c
index 34b4d4c51c..53f1162802 100644
--- a/src/mempool.c
+++ b/src/mempool.c
@@ -14,6 +14,7 @@
* 2006-06-30 Bernard fix the allocate/free block bug
* 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
*/
#include <rthw.h>
@@ -88,7 +89,7 @@ rt_err_t rt_mp_init(struct rt_mempool* mp, const char* name, void *start, rt_siz
/* init memory pool */
mp->start_address = start;
- mp->size = RT_ALIGN(size, RT_ALIGN_SIZE);
+ mp->size = RT_ALIGN_DOWN(size, RT_ALIGN_SIZE);
mp->block_size = block_size;
@@ -294,11 +295,11 @@ void *rt_mp_alloc (rt_mp_t mp, rt_int32_t time)
else
{
/* memory block is unavailable. */
- if (time == 0)
- {
+ if (time == 0)
+ {
/* enable interrupt */
rt_hw_interrupt_enable(level);
- return RT_NULL;
+ return RT_NULL;
}
else
{