ams: prefer construct_at/destroy_at over placement new/explicit destructor

This commit is contained in:
Michael Scire
2021-03-21 20:30:40 -07:00
parent aff0da9427
commit d84dcb653d
49 changed files with 217 additions and 171 deletions

View File

@@ -80,7 +80,7 @@ namespace ams::ddsf {
DeviceCodeEntry &Construct(DeviceCode dc, IDevice *dev) {
AMS_ASSERT(!this->IsConstructed());
DeviceCodeEntry *entry = new (GetPointer(this->entry_storage)) DeviceCodeEntry(dc, dev);
DeviceCodeEntry *entry = util::ConstructAt(this->entry_storage, dc, dev);
this->is_constructed = true;
return *entry;
}
@@ -91,7 +91,7 @@ namespace ams::ddsf {
void Destroy() {
AMS_ASSERT(this->IsConstructed());
GetReference(this->entry_storage).~DeviceCodeEntry();
util::DestroyAt(this->entry_storage);
this->is_constructed = false;
}