JDK-8214272 : Don't use memset to initialize arrays of MemoryUsage in memoryManager.cpp
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-23
  • Updated: 2018-12-05
  • Resolved: 2018-11-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12 b22Fixed
Related Reports
Relates :  
Description
gcc8 warnings:

In multiple places there are errors reported like:

src/hotspot/share/services/memoryManager.cpp:172:40: error: ���void* memset(void*, int, size_t)��� clearing an object of non-trivial type ���class MemoryUsage���; use assignment or value-initialization instead [-Werror=class-memaccess]
   memset(_before_gc_usage_array, 0, len);
                                        ^

These could be fixed using placement new, e.g.

  ::new (_before_gc_usage_array) MemoryUsage()

Comments
Added matcher.cpp http://cr.openjdk.java.net/~dchuyko/8214272/webrev.01/
27-11-2018

http://cr.openjdk.java.net/~dchuyko/8214272/webrev.00/
27-11-2018