mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-16 16:14:25 -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
|
@ -66,13 +66,13 @@ namespace ams::dmnt::cheat::impl {
|
|||
FrozenAddressMapEntry *AllocateFrozenAddress(u64 address, FrozenAddressValue value) {
|
||||
FrozenAddressMapEntry *entry = static_cast<FrozenAddressMapEntry *>(lmem::AllocateFromUnitHeap(g_frozen_address_map_heap));
|
||||
if (entry != nullptr) {
|
||||
new (entry) FrozenAddressMapEntry(address, value);
|
||||
std::construct_at(entry, address, value);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
void DeallocateFrozenAddress(FrozenAddressMapEntry *entry) {
|
||||
entry->~FrozenAddressMapEntry();
|
||||
std::destroy_at(entry);
|
||||
lmem::FreeToUnitHeap(g_frozen_address_map_heap, entry);
|
||||
}
|
||||
|
||||
|
@ -1160,7 +1160,7 @@ namespace ams::dmnt::cheat::impl {
|
|||
g_frozen_address_map_heap = lmem::CreateUnitHeap(g_frozen_address_map_memory, sizeof(g_frozen_address_map_memory), sizeof(FrozenAddressMapEntry), lmem::CreateOption_ThreadSafe);
|
||||
|
||||
/* Create the cheat process manager (spawning its threads). */
|
||||
new (GetPointer(g_cheat_process_manager)) CheatProcessManager;
|
||||
util::ConstructAt(g_cheat_process_manager);
|
||||
}
|
||||
|
||||
bool GetHasActiveCheatProcess() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue