Re: [PATCH 1/2] index-pack: reduce object_entry size to save memory
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 23, 2015, 02:37 UTC
- Message-ID
- <xmqqegphuze8.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1424397488-22169-2-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 14 quoted lines
> diff --git a/builtin/index-pack.c b/builtin/index-pack.c
> index 4632117..07b2c0c 100644
> --- a/builtin/index-pack.c
> +++ b/builtin/index-pack.c
> @@ -18,9 +18,12 @@ static const char index_pack_usage[] =
> struct object_entry {
> struct pack_idx_entry idx;
> unsigned long size;
> - unsigned int hdr_size;
> - enum object_type type;
> - enum object_type real_type;
> + unsigned char hdr_size;
> + char type;
> + char real_type;Don't you need these two fields to be able to hold a negative value like OBJ_BAD (= -1)? You'd need to spell "signed char" out here.