Merge
authordsamersoff
Tue, 20 Dec 2016 11:19:36 +0000
changeset 42893 16dd6b309a48
parent 42892 085c0b161faf (current diff)
parent 42886 9d8028808e78 (diff)
child 42894 be8aea95908b
Merge
--- a/hotspot/src/share/vm/logging/logFileStreamOutput.cpp	Tue Dec 20 14:15:02 2016 +0300
+++ b/hotspot/src/share/vm/logging/logFileStreamOutput.cpp	Tue Dec 20 11:19:36 2016 +0000
@@ -29,11 +29,17 @@
 #include "memory/allocation.inline.hpp"
 
 static bool initialized;
-static char stdoutmem[sizeof(LogStdoutOutput)];
-static char stderrmem[sizeof(LogStderrOutput)];
+static union {
+  char stdoutmem[sizeof(LogStdoutOutput)];
+  jlong dummy;
+} aligned_stdoutmem;
+static union {
+  char stderrmem[sizeof(LogStderrOutput)];
+  jlong dummy;
+} aligned_stderrmem;
 
-LogStdoutOutput &StdoutLog = reinterpret_cast<LogStdoutOutput&>(stdoutmem);
-LogStderrOutput &StderrLog = reinterpret_cast<LogStderrOutput&>(stderrmem);
+LogStdoutOutput &StdoutLog = reinterpret_cast<LogStdoutOutput&>(aligned_stdoutmem.stdoutmem);
+LogStderrOutput &StderrLog = reinterpret_cast<LogStderrOutput&>(aligned_stderrmem.stderrmem);
 
 LogFileStreamInitializer::LogFileStreamInitializer() {
   if (!initialized) {