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

Re: [PATCH v2 7/7] unpack-trees: free cache_entry array members for merges

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jun 3, 2013, 00:04 UTC
Message-ID
<CAMP44s2HotyK7hh0nFjCe+BBtu1pyqmkn6=yt9WV6UyhxjrXoQ@mail.gmail.com>
In-Reply-To
<51ABD99A.2030303@lsrfire.ath.cx>

On Sun, Jun 2, 2013 at 6:47 PM, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:

Show 14 quoted lines
> Am 03.06.2013 01:23, schrieb Felipe Contreras:
>
>> I didn't say we should do 'if (ce) free(ce);' instead of 'free(ce);' I
>> said we should do 'if (cd && ce != o->df_conflict_entry)' instead of
>> 'if (ce != o->df_conflict_entry)'.
>
>
> I did assume you meant the latter.
>
>
>> There's no reason not to.
>
>
> Only the minor ones already mentioned: More text,
Five characters.
> one more branch in object
> code,
Which might actually be more optimal.
> no benefit except for some hypothetical future case that's caught by
> the test suite anyway -- or by code review.
That's not the benefit, the benefit is that the code is clearer.
> I wonder if we already reached the point where we spent more time discussing
> this change than the time needed by the envisioned developer to find and fix
> the NULL check that suddenly became necessary. :)

Maybe, but if what you want is to avoid the discussion, you could just add the extra five characters and be done with it.

-- 
Felipe Contreras
Previous: René ScharfeNext: René Scharfe
Message 17 of 22 in “unpack-trees: plug memory leak for merges”
  1. 0/7 unpack-trees: plug memory leak for mergesRené Scharfe, Jun 2, 2013
  2. 1/7 cache: mark cache_entry pointers constRené Scharfe, Jun 2, 2013
  3. 2/7 read-cache: mark cache_entry pointers constRené Scharfe, Jun 2, 2013
  4. 3/7 unpack-trees: factor out dup_entryRené Scharfe, Jun 2, 2013
  5. 4/7 unpack-trees: create working copy of merge entry in merged_entryRené Scharfe, Jun 2, 2013
  6. 5/7 diff-lib, read-tree, unpack-trees: mark cache_entry pointers constRené Scharfe, Jun 2, 2013
  7. 6/7 diff-lib, read-tree, unpack-trees: mark cache_entry array paramters constRené Scharfe, Jun 2, 2013
  8. 7/7 unpack-trees: free cache_entry array members for mergesRené Scharfe, Jun 2, 2013
  9. Felipe ContrerasJun 2, 2013
  10. René ScharfeJun 2, 2013
  11. Felipe ContrerasJun 2, 2013
  12. René ScharfeJun 2, 2013
  13. Felipe ContrerasJun 2, 2013
  14. René ScharfeJun 2, 2013
  15. Felipe ContrerasJun 2, 2013
  16. René ScharfeJun 2, 2013
  17. Felipe ContrerasJun 3, 2013
  18. René ScharfeJun 3, 2013
  19. Felipe ContrerasJun 3, 2013
  20. 8/7 unpack-trees: document that pointer ce can be NULLRené Scharfe, Jun 3, 2013
  21. Junio C HamanoJun 3, 2013
  22. Felipe ContrerasJun 3, 2013

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.