Re: [PATCH] read-cache: avoid misaligned reads in index v4
From: Junio C Hamano <hidden>
Date: 2022-09-26 18:09:27
From: Junio C Hamano <hidden>
Date: 2022-09-26 18:09:27
Phillip Wood [off-list ref] writes:
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.