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:
Alexander Boettcher 2017-01-19 13:57:03 +01:00 committed by Norman Feske
parent b57834f26b
commit f52c44647f

View File

@ -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',