From f0d048bf9170f7b81f726f7a44079741f74b924a Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 13 May 2005 10:18:21 +0000 Subject: Added ASSERT() macro --- src/core/heap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/heap.c b/src/core/heap.c index 3476f4d25..05fbb6bac 100644 --- a/src/core/heap.c +++ b/src/core/heap.c @@ -3,8 +3,6 @@ #include "memsizes.h" #include "heap.h" -#define ASSERT(...) - struct heap_block { size_t size; char data[0]; @@ -102,7 +100,7 @@ void * emalloc ( size_t size, unsigned int align ) { physaddr_t addr; struct heap_block *block; - ASSERT ( ! ( align & ( align - 1 ) ) ); + ASSERT ( ( align & ( align - 1 ) ) == 0 ); addr = ( ( ( heap_ptr - size ) & ~( align - 1 ) ) - sizeof ( struct heap_block ) ); @@ -132,7 +130,7 @@ void * emalloc_all ( size_t *size ) { void efree ( void *ptr ) { struct heap_block *block; - ASSERT ( ptr == ( heap_ptr + sizeof ( size_t ) ) ); + ASSERT ( ptr == phys_to_virt ( heap_ptr + sizeof ( size_t ) ) ); block = ( struct heap_block * ) ( ptr - offsetof ( struct heap_block, data ) ); -- cgit v1.2.3-55-g7522