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_alignment_matching_storage.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_alignment_matching_storage.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/file_sys/fssystem/fssystem_alignment_matching_storage.h b/src/core/file_sys/fssystem/fssystem_alignment_matching_storage.h index 27d34fd17..f96691d03 100644 --- a/src/core/file_sys/fssystem/fssystem_alignment_matching_storage.h +++ b/src/core/file_sys/fssystem/fssystem_alignment_matching_storage.h @@ -34,7 +34,7 @@ public: virtual size_t Read(u8* buffer, size_t size, size_t offset) const override { // Allocate a work buffer on stack. - alignas(DataAlignMax) char work_buf[DataAlign]; + alignas(DataAlignMax) std::array<char, DataAlign> work_buf; // Succeed if zero size. if (size == 0) { @@ -47,13 +47,13 @@ public: s64 bs_size = this->GetSize(); ASSERT(R_SUCCEEDED(IStorage::CheckAccessRange(offset, size, bs_size))); - return AlignmentMatchingStorageImpl::Read(m_base_storage, work_buf, sizeof(work_buf), + return AlignmentMatchingStorageImpl::Read(m_base_storage, work_buf.data(), work_buf.size(), DataAlign, BufferAlign, offset, buffer, size); } virtual size_t Write(const u8* buffer, size_t size, size_t offset) override { // Allocate a work buffer on stack. - alignas(DataAlignMax) char work_buf[DataAlign]; + alignas(DataAlignMax) std::array<char, DataAlign> work_buf; // Succeed if zero size. if (size == 0) { @@ -66,7 +66,7 @@ public: s64 bs_size = this->GetSize(); ASSERT(R_SUCCEEDED(IStorage::CheckAccessRange(offset, size, bs_size))); - return AlignmentMatchingStorageImpl::Write(m_base_storage, work_buf, sizeof(work_buf), + return AlignmentMatchingStorageImpl::Write(m_base_storage, work_buf.data(), work_buf.size(), DataAlign, BufferAlign, offset, buffer, size); } |