summaryrefslogtreecommitdiff
path: root/pack-objects.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-04-14 15:35:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-16 03:38:58 (GMT)
commitb5c0cbd8083f71e071207fca0d5434c6db6ff6c9 (patch)
tree95a653e9ace7710e94a4d43438ed67b851141e0b /pack-objects.h
parent0c6804ab4ee5cfa47fe28e0a2d20415c5c1f8884 (diff)
downloadgit-b5c0cbd8083f71e071207fca0d5434c6db6ff6c9.zip
git-b5c0cbd8083f71e071207fca0d5434c6db6ff6c9.tar.gz
git-b5c0cbd8083f71e071207fca0d5434c6db6ff6c9.tar.bz2
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>
Diffstat (limited to 'pack-objects.h')
-rw-r--r--pack-objects.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/pack-objects.h b/pack-objects.h
index 080ef62..cdce164 100644
--- a/pack-objects.h
+++ b/pack-objects.h
@@ -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 {