RFR: 8357579: Compilation error: first argument in call to 'memset' is a pointer to non-trivially copyable type [v11]

Jan Kratochvil jkratochvil at openjdk.org
Mon Nov 10 07:24:52 UTC 2025


On Mon, 10 Nov 2025 05:30:37 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> I have removed it, but I disagree, as there’s no way to make such a foolproof assertion in C++.
>
> My objection to the original comments is they don't explain the purpose of the explicit paddings, or how to "verify no compiler paddings are present". I think it's better to add a comment like:
> 
> 
> // The explicit paddings are necessary for generating deterministic CDS archives. They prevent
> // the C++ compiler from potentially inserting random values in unused gaps.
> 
> 
> So if someone changes this file and the CDS tests fails, the comment will give them some ideas about how to fix the problem.

This is the best, thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26098#discussion_r2509041030


More information about the hotspot-dev mailing list