From 7bd8cc53fc013aed452ae12f0405242f35c0860c Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sun, 25 Dec 2016 00:48:15 +0100 Subject: extfs: Swap order of member variables Since we know that sizeof(extfs_superblock) is guaranteed to be 1024, we should move it to the begining of the data member list. Since 1024 is a power of two, we can be pretty certain, that no padding will be inserted after fs::extfs::m_primarySuperblock. std::fstream however makes no guarantees as to what it size is. Thus we would risk the insertion of padding. --- include/fs/extfs.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/fs/extfs.hpp') diff --git a/include/fs/extfs.hpp b/include/fs/extfs.hpp index fb8f044..545a840 100644 --- a/include/fs/extfs.hpp +++ b/include/fs/extfs.hpp @@ -78,8 +78,8 @@ namespace fs bool has_label() const; private: - std::fstream m_stream{}; detail::extfs_superblock m_primarySuperblock{}; + std::fstream m_stream{}; }; } -- cgit v1.2.3