From 214e44c3f9d79e34719cd9cef5e2fc596a693d47 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Tue, 13 Jul 2010 07:36:37 +0000 Subject: 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 --- src/mempool.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mempool.c') 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 @@ -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 { -- cgit v1.3.1