mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 20:05:54 +00:00
core: handle out-of-memory in RM service
This patch adds the missing exception handling for depleted RM session quotas. If core runs out of session quota while creating a new region map, it now reflects this condition as a Region_map::Out_of_metadata exception to the RM client. Thanks to Denis Huber for reporting the issue!
This commit is contained in:
parent
dc26910fc3
commit
fac69eff48
@ -77,13 +77,16 @@ class Genode::Rm_session_component : public Rpc_object<Rm_session>
|
||||
{
|
||||
Lock::Guard guard(_region_maps_lock);
|
||||
|
||||
Region_map_component *rm =
|
||||
new (_md_alloc)
|
||||
Region_map_component(_ep, _md_alloc, _pager_ep, 0, size);
|
||||
try {
|
||||
Region_map_component *rm =
|
||||
new (_md_alloc)
|
||||
Region_map_component(_ep, _md_alloc, _pager_ep, 0, size);
|
||||
|
||||
_region_maps.insert(rm);
|
||||
_region_maps.insert(rm);
|
||||
|
||||
return rm->cap();
|
||||
return rm->cap();
|
||||
}
|
||||
catch (Allocator::Out_of_memory) { throw Out_of_metadata(); }
|
||||
}
|
||||
|
||||
void destroy(Capability<Region_map> rm) override
|
||||
|
Loading…
x
Reference in New Issue
Block a user