mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-30 16:14:13 +00:00
nova: avoid invalid capability counting overhead
- handle it the same way as done for other kernels Fixes #3579
This commit is contained in:
parent
b931b67cba
commit
a41dd48986
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user