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

Re: [PATCH] repository.c: always allocate 'index' at repo init time

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2019, 16:07 UTC
Message-ID
<xmqqblzm5zqn.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CACsJy8CoauTdJ1huU=w2YNbw53iea5U304yAu2oCUuTvFRaV7w@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 12 quoted lines
> On Mon, May 20, 2019 at 8:17 PM Jeff King <peff@peff.net> wrote:
>> The patch looks good, though I wonder if we could simplify even further
>> by just embedding an index into the repository object. The purpose of
>> having it as a pointer, I think, is so that the_repository can point to
>> the_index. But we could possibly hide the latter behind some macro
>> trickery like:
>>
>>   #define the_index (the_repository->index)
> ...
>> So it's definitely non-trivial to go that way. I'm not sure if it's
>> worth the effort to switch at this point, but even if it is, your patch
>> seems like a good thing to do in the meantime.

Yeah, the fact that the_reopsitory->index is not an embedded instance has bothered me from the very beginning, and I am happy to see others share the same feeling ;-)

Show 5 quoted lines
>> Either way, I think we could probably revert the non-test portion of my
>> 581d2fd9f2 (get_oid: handle NULL repo->index, 2019-05-14) after this.
>
> Yeah. I'm thinking of doing that after, scanning for similar lines
> too. But it looks like it's the only one. Will fix in v2.
Thanks.
Previous: Jeff King
Message 16 of 16 in “new segfault in master (6a6c0f10a70a6eb1)”
  1. Eric WongMay 11, 2019
  2. Jeff KingMay 11, 2019
  3. Jeff KingMay 11, 2019
  4. Duy NguyenMay 12, 2019
  5. get_oid: handle NULL repo->indexJeff King, May 14, 2019
  6. Eric WongMay 14, 2019
  7. Duy NguyenMay 15, 2019
  8. Jeff KingMay 15, 2019
  9. Junio C HamanoMay 15, 2019
  10. Duy NguyenMay 15, 2019
  11. Junio C HamanoMay 16, 2019
  12. repository.c: always allocate 'index' at repo init timeNguyễn Thái Ngọc Duy, May 19, 2019
  13. Jeff KingMay 20, 2019
  14. Duy NguyenMay 21, 2019
  15. Jeff KingMay 21, 2019
  16. Junio C HamanoMay 28, 2019

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.