1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-23 04:12:02 +00:00

fs: allocations with mutex held must be unsafe

This commit is contained in:
Michael Scire 2021-12-06 20:35:48 -08:00 committed by SciresM
parent 64b4cc25fc
commit f3dbdc2391

View file

@ -97,9 +97,9 @@ namespace ams::fs {
Impl::LockAllocatorMutex(); Impl::LockAllocatorMutex();
/* Check that we can allocate memory (using overestimate of 0x80 + sizeof(T)). */ /* Check that we can allocate memory (using overestimate of 0x80 + sizeof(T)). */
if (auto * const p = Impl::Allocate(0x80 + sizeof(T)); AMS_LIKELY(p != nullptr)) { if (auto * const p = Impl::AllocateUnsafe(0x80 + sizeof(T)); AMS_LIKELY(p != nullptr)) {
/* Free the memory we allocated. */ /* Free the memory we allocated. */
Impl::Deallocate(p, 0x80 + sizeof(T)); Impl::DeallocateUnsafe(p, 0x80 + sizeof(T));
/* Get allocator type. */ /* Get allocator type. */
using AllocatorType = AllocatorTemplateT<T, Impl>; using AllocatorType = AllocatorTemplateT<T, Impl>;