mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +00:00
core: replace misleading avl warning in detach
If the detach address is not the beginning of the region, one gets: "virtual void Genode::Allocator_avl_base::free(void*): given address (0x180e0) is not the block start address (0x18000)" Instead, print an explicit warning in front of the detach call.
This commit is contained in:
parent
b57834f26b
commit
f52c44647f
@ -453,6 +453,10 @@ void Region_map_component::detach(Local_addr local_addr)
|
||||
return;
|
||||
}
|
||||
|
||||
if (region_ptr->base() != static_cast<addr_t>(local_addr))
|
||||
warning("detach: ", static_cast<void *>(local_addr), " is not "
|
||||
"the beginning of the region ", Hex(region_ptr->base()));
|
||||
|
||||
Dataspace_component *dsc = region_ptr->dataspace();
|
||||
if (!dsc)
|
||||
warning("detach: region of ", this, " may be inconsistent!");
|
||||
@ -478,7 +482,7 @@ void Region_map_component::detach(Local_addr local_addr)
|
||||
* refer to an empty region not to the dataspace, which we just removed.
|
||||
*/
|
||||
if (platform()->supports_unmap())
|
||||
_map.free(local_addr);
|
||||
_map.free(reinterpret_cast<void *>(region.base()));
|
||||
|
||||
/*
|
||||
* This function gets called from the destructor of 'Dataspace_component',
|
||||
|
Loading…
x
Reference in New Issue
Block a user