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

Re: [PATCH 3/3] raw_object_store: drop extra pointer to replace_map

From
Patrick Steinhardt <ps@pks.im>
Date
May 13, 2025, 09:48 UTC
Message-ID
<aCMVfHbB7pJ6Mo4j@pks.im>
In-Reply-To
<20250512185233.GC1276214@coredump.intra.peff.net>
On Mon, May 12, 2025 at 02:52:33PM -0400, Jeff King wrote:
Show 12 quoted lines
> We store the replacement data in an oidmap, which is itself a pointer in
> the raw_object_store struct. But there's no need for an extra pointer
> indirection here. It is always allocated and initialized along with the
> containing struct, and we never check it for NULL-ness.
> 
> Let's embed the map directly in the struct, which is simpler and avoids
> extra pointer chasing.
> 
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> This one may be more subjective, but IMHO it's good to avoid extra
> pointers when we can.

Yup, I agree it is a sensible step. There is no good reason why the map should be allocated, so let's just not.

All of these cleanups in this series look good to me. Thanks!
Patrick
Previous: Jeff KingNext: Junio C Hamano
Message 7 of 8 in “minor oidmap cleanups”
  1. 0/3 minor oidmap cleanupsJeff King, May 12, 2025
  2. 1/3 oidmap: rename oidmap_free() to oidmap_clear()Jeff King, May 12, 2025
  3. 2/3 oidmap: add size functionJeff King, May 12, 2025
  4. Patrick SteinhardtMay 13, 2025
  5. Jeff KingMay 14, 2025
  6. 3/3 raw_object_store: drop extra pointer to replace_mapJeff King, May 12, 2025
  7. Patrick SteinhardtMay 13, 2025
  8. Junio C HamanoMay 14, 2025

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.