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

Re: [PATCH] repository: fix free problem with repo_clear(the_repository)

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2018, 09:27 UTC
Message-ID
<xmqqbmdnkgh4.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAGZ79kbFiULj1NJARm6ObYrqv_Fu+U2sb8h_sNJwdWur+JqrvQ@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 12 quoted lines
> So this would go with the latest sb/object-store-alloc ?
>
> My impression was that we never call repo_clear() on
> the_repository, which would allow us to special case
> the_repository further just as I did in v2 of that series[1] by
> having static allocations for certain objects in case of \
> the_repository.
>
> [1] https://public-inbox.org/git/20180501213403.14643-14-sbeller@google.com/
>
> We could just deal with all the exceptions, but that makes repo_clear
> ugly IMHO.
So perhaps
         void repo_clear(...)
         {
        +       if (repo == the_repository)
        +               BUG("repo_clear() called on the repository");
                ...
or something?
Previous: Duy NguyenNext: Stefan Beller
Message 9 of 11 in “repository: fix free problem with repo_clear(the_repository)”
  1. repository: fix free problem with repo_clear(the_repository)Nguyễn Thái Ngọc Duy, May 9, 2018
  2. Brandon WilliamsMay 9, 2018
  3. Elijah NewrenMay 9, 2018
  4. Duy NguyenMay 9, 2018
  5. Stefan BellerMay 9, 2018
  6. Duy NguyenMay 9, 2018
  7. Stefan BellerMay 9, 2018
  8. Duy NguyenMay 10, 2018
  9. Junio C HamanoMay 10, 2018
  10. Stefan BellerMay 10, 2018
  11. repository: fix free problem with repo_clear(the_repository)Nguyễn Thái Ngọc Duy, May 10, 2018

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.