mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
'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:
committed by
Norman Feske
parent
a48942bffc
commit
22cc867234
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user