nova: avoid invalid capability counting overhead

- handle it the same way as done for other kernels

Fixes #3579
This commit is contained in:
Alexander Boettcher 2019-12-13 11:34:25 +01:00 committed by Christian Helmuth
parent b931b67cba
commit a41dd48986

View File

@ -21,14 +21,13 @@
using namespace Genode; using namespace Genode;
Native_capability::Native_capability() Native_capability::Native_capability() { }
{
*this = Capability_space::import(Capability_space::INVALID_INDEX);
}
void Native_capability::_inc() void Native_capability::_inc()
{ {
if (!valid()) return;
Cap_index idx(cap_map().find(local_name())); Cap_index idx(cap_map().find(local_name()));
idx.inc(); idx.inc();
} }
@ -36,6 +35,8 @@ void Native_capability::_inc()
void Native_capability::_dec() void Native_capability::_dec()
{ {
if (!valid()) return;
Cap_index idx(cap_map().find(local_name())); Cap_index idx(cap_map().find(local_name()));
idx.dec(); idx.dec();
} }