changeset 53937:2998e6d76879

8214376: Don't use memset to initialize array of Bundle in output.cpp Reviewed-by: thartmann, shade
author dchuyko
date Fri, 07 Dec 2018 17:52:37 +0300
parents 325c95779368
children 3ba9ff4d4aaf
files src/hotspot/share/opto/output.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/opto/output.cpp	Fri Dec 07 14:19:20 2018 +0100
+++ b/src/hotspot/share/opto/output.cpp	Fri Dec 07 17:52:37 2018 +0300
@@ -1704,7 +1704,9 @@
   _current_latency = NEW_ARENA_ARRAY(arena, unsigned short, node_max);
 
   // Clear the arrays
-  memset(_node_bundling_base, 0, node_max * sizeof(Bundle));
+  for (uint i = 0; i < node_max; i++) {
+    ::new (&_node_bundling_base[i]) Bundle();
+  }
   memset(_node_latency,       0, node_max * sizeof(unsigned short));
   memset(_uses,               0, node_max * sizeof(short));
   memset(_current_latency,    0, node_max * sizeof(unsigned short));