mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-16 08:04:23 -04:00
kern: optimize handle table layout
This commit is contained in:
parent
6407786059
commit
183243bf16
2 changed files with 11 additions and 26 deletions
|
@ -74,7 +74,7 @@ namespace ams::kern {
|
|||
return true;
|
||||
}
|
||||
|
||||
Result KHandleTable::Add(ams::svc::Handle *out_handle, KAutoObject *obj, u16 type) {
|
||||
Result KHandleTable::Add(ams::svc::Handle *out_handle, KAutoObject *obj) {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
KScopedDisableDispatch dd;
|
||||
KScopedSpinLock lk(m_lock);
|
||||
|
@ -87,8 +87,8 @@ namespace ams::kern {
|
|||
const auto linear_id = this->AllocateLinearId();
|
||||
const auto index = this->AllocateEntry();
|
||||
|
||||
m_entry_infos[index].info = { .linear_id = linear_id, .type = type };
|
||||
m_objects[index] = obj;
|
||||
m_entry_infos[index].linear_id = linear_id;
|
||||
m_objects[index] = obj;
|
||||
|
||||
obj->Open();
|
||||
|
||||
|
@ -131,7 +131,7 @@ namespace ams::kern {
|
|||
}
|
||||
}
|
||||
|
||||
void KHandleTable::Register(ams::svc::Handle handle, KAutoObject *obj, u16 type) {
|
||||
void KHandleTable::Register(ams::svc::Handle handle, KAutoObject *obj) {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
KScopedDisableDispatch dd;
|
||||
KScopedSpinLock lk(m_lock);
|
||||
|
@ -149,8 +149,8 @@ namespace ams::kern {
|
|||
/* Set the entry. */
|
||||
MESOSPHERE_ASSERT(m_objects[index] == nullptr);
|
||||
|
||||
m_entry_infos[index].info = { .linear_id = linear_id, .type = type };
|
||||
m_objects[index] = obj;
|
||||
m_entry_infos[index].linear_id = linear_id;
|
||||
m_objects[index] = obj;
|
||||
|
||||
obj->Open();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue