From 50eee9b2185c59c32fb82cf464230a058edd10ea Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 12 Aug 2023 15:18:55 -0400 Subject: fssystem: rework for yuzu style --- .../file_sys/fssystem/fssystem_pooled_buffer.h | 41 +++++++++++----------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'src/core/file_sys/fssystem/fssystem_pooled_buffer.h') diff --git a/src/core/file_sys/fssystem/fssystem_pooled_buffer.h b/src/core/file_sys/fssystem/fssystem_pooled_buffer.h index 1df3153a1..9a6adbcb5 100644 --- a/src/core/file_sys/fssystem/fssystem_pooled_buffer.h +++ b/src/core/file_sys/fssystem/fssystem_pooled_buffer.h @@ -18,27 +18,6 @@ constexpr inline size_t BufferPoolWorkSize = 320; class PooledBuffer { YUZU_NON_COPYABLE(PooledBuffer); -private: - char* m_buffer; - size_t m_size; - -private: - static size_t GetAllocatableSizeMaxCore(bool large); - -public: - static size_t GetAllocatableSizeMax() { - return GetAllocatableSizeMaxCore(false); - } - static size_t GetAllocatableParticularlyLargeSizeMax() { - return GetAllocatableSizeMaxCore(true); - } - -private: - void Swap(PooledBuffer& rhs) { - std::swap(m_buffer, rhs.m_buffer); - std::swap(m_size, rhs.m_size); - } - public: // Constructor/Destructor. constexpr PooledBuffer() : m_buffer(), m_size() {} @@ -89,8 +68,28 @@ public: return m_size; } +public: + static size_t GetAllocatableSizeMax() { + return GetAllocatableSizeMaxCore(false); + } + static size_t GetAllocatableParticularlyLargeSizeMax() { + return GetAllocatableSizeMaxCore(true); + } + +private: + static size_t GetAllocatableSizeMaxCore(bool large); + private: + void Swap(PooledBuffer& rhs) { + std::swap(m_buffer, rhs.m_buffer); + std::swap(m_size, rhs.m_size); + } + void AllocateCore(size_t ideal_size, size_t required_size, bool large); + +private: + char* m_buffer; + size_t m_size; }; } // namespace FileSys -- cgit v1.2.3