RFR: 8366193: Add comments about ResolvedFieldEntry::copy_from()
Ioi Lam
iklam at openjdk.org
Thu Aug 28 18:11:51 UTC 2025
On Wed, 27 Aug 2025 12:40:02 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> [JDK-8293980](https://bugs.openjdk.org/browse/JDK-8293980) added `ResolvedFieldEntry::copy_from()` to prevent random bits in the CDS archive. However, I forgot to add a comment to explain why this is necessary.
>>
>> This PR adds the missing comment, which will be useful if we consider alternative solutions (using `memset()` in constructor??) in the future.
>
> This comment is helpful. At one point, I made Metaspace::allocate not zero memory and several things broke. This would have been one of them it if existed. I don't know if there's a better solution to to ensuring alignment gaps in fields always zeroed.
Thanks @coleenp and @adinn for the review.
I am pushing this PR to add comments on the existing code. Please continue discussion about any potential improvements (but perhaps in a different PR/email?)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26946#issuecomment-3234462302
More information about the hotspot-dev
mailing list