pack-objects: shrink delta_size field in struct object_entry
commit0aca34e8269514ebb67676e0470a314615494ae8
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 14 Apr 2018 15:35:11 +0000 (14 17:35 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Apr 2018 03:38:59 +0000 (16 12:38 +0900)
tree18835e8a3322ddb23f021b413aed31f907772949
parentac77d0c370dc5b23ac1ec4a13c754fe7ffa48564
pack-objects: shrink delta_size field in struct object_entry

Allowing a delta size of 64 bits is crazy. Shrink this field down to
20 bits with one overflow bit.

If we find an existing delta larger than 1MB, we do not cache
delta_size at all and will get the value from oe_size(), potentially
from disk if it's larger than 4GB.

Note, since DELTA_SIZE() is used in try_delta() code, it must be
thread-safe. Luckily oe_size() does guarantee this so we it is
thread-safe.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
pack-objects.h