mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-21 02:15:07 -04:00
ams: prefer construct_at/destroy_at over placement new/explicit destructor
This commit is contained in:
parent
aff0da9427
commit
d84dcb653d
49 changed files with 217 additions and 171 deletions
|
@ -72,7 +72,7 @@ namespace ams::os {
|
|||
AMS_ASSERT((lock_level == 0) || (MutexLockLevelMin <= lock_level && lock_level <= MutexLockLevelMax));
|
||||
|
||||
/* Create object. */
|
||||
new (GetPointer(mutex->_storage)) impl::InternalCriticalSection;
|
||||
util::ConstructAt(mutex->_storage);
|
||||
|
||||
/* Set member variables. */
|
||||
mutex->is_recursive = recursive;
|
||||
|
@ -91,7 +91,7 @@ namespace ams::os {
|
|||
mutex->state = MutexType::State_NotInitialized;
|
||||
|
||||
/* Destroy object. */
|
||||
GetReference(mutex->_storage).~InternalCriticalSection();
|
||||
util::DestroyAt(mutex->_storage);
|
||||
}
|
||||
|
||||
void LockMutex(MutexType *mutex) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue