diff options
Diffstat (limited to 'src/memheap.c')
| -rw-r--r-- | src/memheap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/memheap.c b/src/memheap.c index 4b09fead01..edc1eb2641 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -40,7 +40,7 @@ #define RT_MEMHEAP_MINIALLOC RT_ALIGN(12, RT_ALIGN_SIZE) #define RT_MEMHEAP_SIZE RT_ALIGN(sizeof(struct rt_memheap_item), RT_ALIGN_SIZE) -#define MEMITEM_SIZE(item) ((rt_ubase_t)item->next - (rt_ubase_t)item - RT_MEMHEAP_SIZE) +#define MEMITEM_SIZE(item) ((rt_uintptr_t)item->next - (rt_uintptr_t)item - RT_MEMHEAP_SIZE) #define MEMITEM(ptr) (struct rt_memheap_item*)((rt_uint8_t*)ptr - RT_MEMHEAP_SIZE) static void _remove_next_ptr(volatile struct rt_memheap_item *next_ptr) @@ -899,10 +899,10 @@ static int memheapcheck(int argc, char *argv[]) break; } /* check next and prev */ - if (!((rt_ubase_t)item->next <= (rt_ubase_t)((rt_ubase_t)heap->start_addr + heap->pool_size) && - (rt_ubase_t)item->prev >= (rt_ubase_t)heap->start_addr) && - (rt_ubase_t)item->next == RT_ALIGN((rt_ubase_t)item->next, RT_ALIGN_SIZE) && - (rt_ubase_t)item->prev == RT_ALIGN((rt_ubase_t)item->prev, RT_ALIGN_SIZE)) + if (!((rt_uintptr_t)item->next <= (rt_uintptr_t)((rt_uintptr_t)heap->start_addr + heap->pool_size) && + (rt_uintptr_t)item->prev >= (rt_uintptr_t)heap->start_addr) && + (rt_uintptr_t)item->next == RT_ALIGN((rt_uintptr_t)item->next, RT_ALIGN_SIZE) && + (rt_uintptr_t)item->prev == RT_ALIGN((rt_uintptr_t)item->prev, RT_ALIGN_SIZE)) { has_bad = RT_TRUE; break; |
