From: Eric Biggers Date: Sun, 31 May 2015 05:13:08 +0000 (-0500) Subject: Save memory by avoiding padding after sha1_hash fields X-Git-Tag: v1.8.2~97 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=1e70063e885540667e1873787e6b21f5c6704ac4 Save memory by avoiding padding after sha1_hash fields --- diff --git a/include/wimlib/blob_table.h b/include/wimlib/blob_table.h index 6dbbe55a..ee1cd0fa 100644 --- a/include/wimlib/blob_table.h +++ b/include/wimlib/blob_table.h @@ -108,7 +108,7 @@ struct blob_descriptor { struct wim_inode *back_inode; u32 back_stream_id; }; - }; + } _packed_attribute; /* union is SHA1_HASH_SIZE bytes */ /* Number of times this blob is referenced by file streams in WIM * images. See blob_decrement_refcnt() for information about the diff --git a/include/wimlib/inode.h b/include/wimlib/inode.h index 3fbb4039..777a05b5 100644 --- a/include/wimlib/inode.h +++ b/include/wimlib/inode.h @@ -70,7 +70,7 @@ struct wim_inode_stream { union { u8 _stream_hash[SHA1_HASH_SIZE]; struct blob_descriptor *_stream_blob; - }; + } _packed_attribute; /* union is SHA1_HASH_SIZE bytes */ /* 'stream_resolved' determines whether 'stream_hash' or 'stream_blob' * is valid as described above. */