git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] index-pack: reduce object_entry size to save memory

From
Duy Nguyen <pclouds@gmail.com>
Date
Feb 23, 2015, 03:38 UTC
Message-ID
<CACsJy8CGQAx9KVHF_yGHh+zi6xirtP7ZxTb3-2NafGkmjQkcGA@mail.gmail.com>
In-Reply-To
<xmqqegphuze8.fsf@gitster.dls.corp.google.com>
On Mon, Feb 23, 2015 at 9:37 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> 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.

Right. char's signedness is undefined. Can't believe I hit this on ARM not 2 months ago and already forgot the lesson. Will fix.

-- 
Duy
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 4 of 11 in “nd/slim-index-pack-memory-usage updates”
  1. 0/2 nd/slim-index-pack-memory-usage updatesNguyễn Thái Ngọc Duy, Feb 20, 2015
  2. 1/2 index-pack: reduce object_entry size to save memoryNguyễn Thái Ngọc Duy, Feb 20, 2015
  3. Junio C HamanoFeb 23, 2015
  4. Duy NguyenFeb 23, 2015
  5. 2/2 index-pack: kill union delta_base to save memoryNguyễn Thái Ngọc Duy, Feb 20, 2015
  6. 0/2 nd/slim-index-pack-memory-usage updatesNguyễn Thái Ngọc Duy, Feb 26, 2015
  7. 1/2 index-pack: reduce object_entry size to save memoryNguyễn Thái Ngọc Duy, Feb 26, 2015
  8. 2/2 index-pack: kill union delta_base to save memoryNguyễn Thái Ngọc Duy, Feb 26, 2015
  9. Junio C HamanoFeb 27, 2015
  10. Duy NguyenFeb 28, 2015
  11. Junio C HamanoMar 1, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.