diff options
author | Liam <byteslice@airmail.cc> | 2023-08-12 21:18:55 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-08-15 23:47:40 +0200 |
commit | 50eee9b2185c59c32fb82cf464230a058edd10ea (patch) | |
tree | beebc2d0da1fa0678a067de9c12cb7d11c775748 /src/core/file_sys/fssystem/fssystem_pooled_buffer.h | |
parent | fssystem: reduce overalignment of unbuffered storage operations (diff) | |
download | yuzu-50eee9b2185c59c32fb82cf464230a058edd10ea.tar yuzu-50eee9b2185c59c32fb82cf464230a058edd10ea.tar.gz yuzu-50eee9b2185c59c32fb82cf464230a058edd10ea.tar.bz2 yuzu-50eee9b2185c59c32fb82cf464230a058edd10ea.tar.lz yuzu-50eee9b2185c59c32fb82cf464230a058edd10ea.tar.xz yuzu-50eee9b2185c59c32fb82cf464230a058edd10ea.tar.zst yuzu-50eee9b2185c59c32fb82cf464230a058edd10ea.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/fssystem/fssystem_pooled_buffer.h | 41 |
1 files changed, 20 insertions, 21 deletions
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 |