]> wimlib.net Git - wimlib/commitdiff
Save memory by avoiding padding after sha1_hash fields
authorEric Biggers <ebiggers3@gmail.com>
Sun, 31 May 2015 05:13:08 +0000 (00:13 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 5 Jun 2015 03:45:34 +0000 (22:45 -0500)
include/wimlib/blob_table.h
include/wimlib/inode.h

index 6dbbe55a7e9c9b489e39c9eeb6ebb28bb8c8650b..ee1cd0faa8f4cb5c544c02d1efb507a56ec21647 100644 (file)
@@ -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
index 3fbb4039d658af19289762946dd16cd127f7bf60..777a05b5440501e66a247bc99bef57d10e9ee835 100644 (file)
@@ -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.  */