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.