commit.h: rearrange 'index' to shrink struct commit
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 11 May 2018 17:20:54 +0000 (19:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 13 May 2018 02:01:48 +0000 (11:01 +0900)
On linux 64-bit architecture, pahole finds that there's a 4 bytes
padding after 'index'. Moving it to the end reduces this struct's size
from 72 to 64 bytes (because of another 4 bytes padding after
graph_pos). On linux 32-bit, the struct size remains 52 bytes like
before.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.h
index e57ae4b58380cce6192cc6489682838677f048ce..fd1cbe72634a66b683bdd543a6cdd5c74eb1fe07 100644 (file)
--- a/commit.h
+++ b/commit.h
@@ -19,11 +19,11 @@ struct commit_list {
 struct commit {
        struct object object;
        void *util;
-       unsigned int index;
        timestamp_t date;
        struct commit_list *parents;
        struct tree *tree;
        uint32_t graph_pos;
+       unsigned int index;
 };
 
 extern int save_commit_buffer;