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

@ -68,7 +68,7 @@ namespace ams::mem {
StandardAllocator::StandardAllocator() : initialized(false), enable_thread_cache(false), unused(0) {
static_assert(sizeof(impl::heap::CentralHeap) <= sizeof(this->central_heap_storage));
new (std::addressof(this->central_heap_storage)) impl::heap::CentralHeap;
std::construct_at(GetCentral(this->central_heap_storage));
}
StandardAllocator::StandardAllocator(void *mem, size_t size) : StandardAllocator() {