Skip to content

Commit 25f859f

Browse files
pcloudsgitster
authored andcommitted
commit.h: rearrange 'index' to shrink struct commit
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ccdcbd5 commit 25f859f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ struct commit_list {
1919
struct commit {
2020
struct object object;
2121
void *util;
22-
unsigned int index;
2322
timestamp_t date;
2423
struct commit_list *parents;
2524
struct tree *tree;
2625
uint32_t graph_pos;
26+
unsigned int index;
2727
};
2828

2929
extern int save_commit_buffer;

0 commit comments

Comments
 (0)