mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
kern: update handle table init
This commit is contained in:
parent
d00406e089
commit
752704a798
1 changed files with 8 additions and 3 deletions
|
@ -70,15 +70,20 @@ namespace ams::kern {
|
||||||
u16 m_next_linear_id;
|
u16 m_next_linear_id;
|
||||||
u16 m_count;
|
u16 m_count;
|
||||||
public:
|
public:
|
||||||
constexpr explicit KHandleTable(util::ConstantInitializeTag) : m_entry_infos(), m_objects(), m_lock(), m_free_head_index(-1), m_table_size(), m_max_count(), m_next_linear_id(MinLinearId), m_count() { /* ... */ }
|
constexpr explicit KHandleTable(util::ConstantInitializeTag) : m_entry_infos(), m_objects(), m_lock(), m_free_head_index(-1), m_table_size(), m_max_count(), m_next_linear_id(), m_count() { /* ... */ }
|
||||||
|
|
||||||
explicit KHandleTable() : m_lock(), m_free_head_index(-1), m_count() { MESOSPHERE_ASSERT_THIS(); }
|
explicit KHandleTable() : m_lock(), m_free_head_index(-1), m_table_size(), m_max_count(), m_next_linear_id(), m_count() { MESOSPHERE_ASSERT_THIS(); }
|
||||||
|
|
||||||
constexpr MESOSPHERE_NOINLINE_IF_DEBUG Result Initialize(s32 size) {
|
MESOSPHERE_NOINLINE_IF_DEBUG Result Initialize(s32 size) {
|
||||||
MESOSPHERE_ASSERT_THIS();
|
MESOSPHERE_ASSERT_THIS();
|
||||||
|
|
||||||
|
/* Check that the table size is valid. */
|
||||||
R_UNLESS(size <= static_cast<s32>(MaxTableSize), svc::ResultOutOfMemory());
|
R_UNLESS(size <= static_cast<s32>(MaxTableSize), svc::ResultOutOfMemory());
|
||||||
|
|
||||||
|
/* Lock. */
|
||||||
|
KScopedDisableDispatch dd;
|
||||||
|
KScopedSpinLock lk(m_lock);
|
||||||
|
|
||||||
/* Initialize all fields. */
|
/* Initialize all fields. */
|
||||||
m_max_count = 0;
|
m_max_count = 0;
|
||||||
m_table_size = (size <= 0) ? MaxTableSize : size;
|
m_table_size = (size <= 0) ? MaxTableSize : size;
|
||||||
|
|
Loading…
Reference in a new issue