RFR: 8214377: ZGC: Don't use memset to initialize array of ZForwardingTableEntry

Roman Kennke rkennke at redhat.com
Thu Nov 29 13:17:53 UTC 2018


Looks good to me! It'll make my compiler happy(ier) :-)

Thanks, Roman

> Use placement new instead of memset() to avoid compiler warning/error
> when using GCC 8 with -Werror=class-memaccess (memset to initialize
> non-trivial object).
> 
> To avoid any undefined behavior I also added a loop to destruct the
> objects properly, but this loop will be compiled down to nothing.
> 
> I ran SPECjbb2015 to see if the execution time for "Prepare Relocation
> Set" was noticeably affected by this change (assuming memset does a
> batter job than then loop), but I can't see any real difference. I'll
> run a few more iterations over night just to make sure.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8214377
> Webrev: http://cr.openjdk.java.net/~pliden/8214377/webrev.0
> 
> /Per

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20181129/8a26e9f1/signature.asc>


More information about the hotspot-gc-dev mailing list