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

Re: [PATCH] read-cache: avoid misaligned reads in index v4

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 26, 2022, 17:54 UTC
Message-ID
<xmqqpmfiowb0.fsf@gitster.g>
In-Reply-To
<bb3a2470-7ff5-e4a6-040a-96e0e3833978@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 5 quoted lines
> I was confused as to why this was safe as it means we're still reading
> the individual fields from unaligned addresses. The reason it is safe
> is that we use get_bexx() to read the fields and those functions
> handle unaligned access. I wonder if it is worth adding a note to
> clarify that if you re-roll.

I've got so used to ours that gives unaligned accesses, but I guess in some other circles, get_XeYY() means reading YY bit-wide integer in X byte-order from a preperly aligned address, and if that is the case, I do not mind such a comment somewhere. It would help those coming from such a background very much.

Thanks.
Previous: Phillip WoodNext: Victoria Dye via GitGitGadget
Message 10 of 12 in “read-cache: avoid misaligned reads in index v4”
  1. read-cache: avoid misaligned reads in index v4Victoria Dye via GitGitGadget, Sep 23, 2022
  2. Jeff KingSep 23, 2022
  3. Junio C HamanoSep 23, 2022
  4. Victoria DyeSep 26, 2022
  5. Jeff KingSep 26, 2022
  6. Jeff KingSep 26, 2022
  7. Jeff KingSep 26, 2022
  8. Junio C HamanoSep 26, 2022
  9. Phillip WoodSep 25, 2022
  10. Junio C HamanoSep 26, 2022
  11. read-cache: avoid misaligned reads in index v4Victoria Dye via GitGitGadget, Sep 28, 2022
  12. Junio C HamanoSep 28, 2022

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.