From 22cc8672346f3e9eaecd78e845bbc6bb56ded15f Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Thu, 1 Nov 2012 21:34:51 +0100 Subject: [PATCH] '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. --- base/src/base/allocator/allocator_avl.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/src/base/allocator/allocator_avl.cc b/base/src/base/allocator/allocator_avl.cc index c41b15eaf8..f46359f38a 100644 --- a/base/src/base/allocator/allocator_avl.cc +++ b/base/src/base/allocator/allocator_avl.cc @@ -12,6 +12,7 @@ */ #include +#include 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);