diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-22 18:34:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-22 18:34:47 +0100 |
commit | d12d9dad4096af6280c6c418cf36a2faacede102 (patch) | |
tree | ba52bf26efd8b2f7bf282b0564a68870022cccb7 /src/core/file_sys/fs_memory_management.h | |
parent | Merge pull request #13000 from liamwhite/skip-null-memory (diff) | |
parent | Address review comments pt. 2 (diff) | |
download | yuzu-d12d9dad4096af6280c6c418cf36a2faacede102.tar yuzu-d12d9dad4096af6280c6c418cf36a2faacede102.tar.gz yuzu-d12d9dad4096af6280c6c418cf36a2faacede102.tar.bz2 yuzu-d12d9dad4096af6280c6c418cf36a2faacede102.tar.lz yuzu-d12d9dad4096af6280c6c418cf36a2faacede102.tar.xz yuzu-d12d9dad4096af6280c6c418cf36a2faacede102.tar.zst yuzu-d12d9dad4096af6280c6c418cf36a2faacede102.zip |
Diffstat (limited to 'src/core/file_sys/fs_memory_management.h')
-rw-r--r-- | src/core/file_sys/fs_memory_management.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/file_sys/fs_memory_management.h b/src/core/file_sys/fs_memory_management.h index f03c6354b..080017c5d 100644 --- a/src/core/file_sys/fs_memory_management.h +++ b/src/core/file_sys/fs_memory_management.h @@ -10,7 +10,7 @@ namespace FileSys { constexpr size_t RequiredAlignment = alignof(u64); -void* AllocateUnsafe(size_t size) { +inline void* AllocateUnsafe(size_t size) { // Allocate void* const ptr = ::operator new(size, std::align_val_t{RequiredAlignment}); @@ -21,16 +21,16 @@ void* AllocateUnsafe(size_t size) { return ptr; } -void DeallocateUnsafe(void* ptr, size_t size) { +inline void DeallocateUnsafe(void* ptr, size_t size) { // Deallocate the pointer ::operator delete(ptr, std::align_val_t{RequiredAlignment}); } -void* Allocate(size_t size) { +inline void* Allocate(size_t size) { return AllocateUnsafe(size); } -void Deallocate(void* ptr, size_t size) { +inline void Deallocate(void* ptr, size_t size) { // If the pointer is non-null, deallocate it if (ptr != nullptr) { DeallocateUnsafe(ptr, size); |