On Mon, 7 Oct 2024 14:50:33 GMT, Vladimir Kozelkov <d...@openjdk.org> wrote:

> I don't really understand why unions should allow PaddingLayout inside 
> themselves at all.

Padding inside unions is required for a case like this:


union Foo {
    long long x;
    int arr[3];
};


Size of the struct without padding is 12 bytes, but it needs 8-byte alignment, 
so it needs 16 bytes of padding.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/21041#issuecomment-2397166726

Reply via email to