mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00: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:
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user