* Avoid padding in structs index_state, packed_git
@ 2015-08-18 10:55 Dilyan Palauzov
0 siblings, 0 replies; only message in thread
From: Dilyan Palauzov @ 2015-08-18 10:55 UTC (permalink / raw)
To: git
On 64 bit linux, sizeof (struct index_state) = 160 and sizeof (struct
packed_git) = 104. This change shrinks the structs with 8bytes (as it
avoids padding)
Signed-off-by: Дилян Палаузов <git-dpa@aegee.org>
---
diff --git a/cache.h b/cache.h
index 6bb7119..e00908b 100644
--- a/cache.h
+++ b/cache.h
@@ -310,11 +310,11 @@ struct index_state {
struct cache_tree *cache_tree;
struct split_index *split_index;
struct cache_time timestamp;
- unsigned name_hash_initialized : 1,
- initialized : 1;
struct hashmap name_hash;
struct hashmap dir_hash;
unsigned char sha1[20];
+ unsigned name_hash_initialized : 1,
+ initialized : 1;
struct untracked_cache *untracked;
};
@@ -1192,8 +1192,8 @@ extern struct packed_git {
uint32_t num_objects;
uint32_t num_bad_objects;
unsigned char *bad_object_sha1;
- int index_version;
time_t mtime;
+ int index_version;
int pack_fd;
unsigned pack_local:1,
pack_keep:1,
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-18 11:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-18 10:55 Avoid padding in structs index_state, packed_git Dilyan Palauzov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).