'Allocator_avl_base::free()': print error message

With this patch an error message gets printed in
'Allocator_avl_base::free()' if the given address is not the start address
of the allocated block.

Fixes #459.
This commit is contained in:
Christian Prochaska 2012-11-01 21:34:51 +01:00 committed by Norman Feske
parent a48942bffc
commit 22cc867234
1 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,7 @@
*/
#include <base/allocator_avl.h>
#include <base/printf.h>
using namespace Genode;
@ -328,6 +329,10 @@ void Allocator_avl_base::free(void *addr)
addr_t new_addr = b->addr();
size_t new_size = b->size();
if (new_addr != (addr_t)addr)
PERR("%s: given address (0x%p) is not the block start address (0x%lx)",
__PRETTY_FUNCTION__, addr, new_addr);
_destroy_block(b);
add_range(new_addr, new_size);