mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-16 08:04:23 -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
|
@ -25,7 +25,7 @@ namespace ams::os {
|
|||
event->clear_mode = static_cast<u8>(clear_mode);
|
||||
|
||||
/* Initialize implementation. */
|
||||
new (GetPointer(event->impl)) impl::InterruptEventImpl(name, clear_mode);
|
||||
util::ConstructAt(event->impl, name, clear_mode);
|
||||
|
||||
/* Mark initialized. */
|
||||
event->state = InterruptEventType::State_Initialized;
|
||||
|
@ -38,7 +38,7 @@ namespace ams::os {
|
|||
event->state = InterruptEventType::State_NotInitialized;
|
||||
|
||||
/* Destroy objects. */
|
||||
GetReference(event->impl).~InterruptEventImpl();
|
||||
util::DestroyAt(event->impl);
|
||||
}
|
||||
|
||||
void WaitInterruptEvent(InterruptEventType *event) {
|
||||
|
@ -65,7 +65,7 @@ namespace ams::os {
|
|||
void InitializeWaitableHolder(WaitableHolderType *waitable_holder, InterruptEventType *event) {
|
||||
AMS_ASSERT(event->state == InterruptEventType::State_Initialized);
|
||||
|
||||
new (GetPointer(waitable_holder->impl_storage)) impl::WaitableHolderOfInterruptEvent(event);
|
||||
util::ConstructAt(GetReference(waitable_holder->impl_storage).holder_of_interrupt_event_storage, event);
|
||||
|
||||
waitable_holder->user_data = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue