On Sat, Feb 17, 2024 at 12:39 AM Jon DeVree <n...@vault24.org> wrote:
>
> On Thu, Feb 15, 2024 at 20:33:13 +0300, Vladimir 'phcoder' Serbinenko wrote:
> > Is the pointer guaranteed to be aligned? If not you have to use unaligned
> > access.
>
> I don't know what alignment guarantees grub_malloc() makes. As long as
> they are close to what the regular C malloc() guarantees then it should
> be fine.

grub_malloc design guarantees the largest natural alignment of all types.
grub_malloc implementation guarantees alignment of 4 * sizeof(void*).

My concern was that the pointer is moved after alloc but it turns own
it was not the case.
So there are no unaligned access concerns

The code still violates cast-align and strict aliasing invariants but
so is the rest of XFS code.
So I'm happy to merge this patch

Reviewed-By: Vladimir Serbinenko <phco...@gmail.com>

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to