pack-objects: use bitfield for object_entry::depth
Because of struct packing from now on we can only handle max depth 4095 (or even lower when new booleans are added in this struct). This should be ok since long delta chain will cause significant slow down anyway. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
0c6804ab4e
commit
b5c0cbd808
@ -2,6 +2,7 @@
|
||||
#define PACK_OBJECTS_H
|
||||
|
||||
#define OE_DFS_STATE_BITS 2
|
||||
#define OE_DEPTH_BITS 12
|
||||
|
||||
/*
|
||||
* State flags for depth-first search used for analyzing delta cycles.
|
||||
@ -89,9 +90,7 @@ struct object_entry {
|
||||
unsigned tagged:1; /* near the very tip of refs */
|
||||
unsigned filled:1; /* assigned write-order */
|
||||
unsigned dfs_state:OE_DFS_STATE_BITS;
|
||||
|
||||
int depth;
|
||||
|
||||
unsigned depth:OE_DEPTH_BITS;
|
||||
};
|
||||
|
||||
struct packing_data {
|
||||
|
Reference in New Issue
Block a user