RFR: 8283469: Don't use memset to initialize members in FileMapInfo and fix memory leak

Zhengyu Gu zgu at openjdk.java.net
Sun Mar 27 15:57:46 UTC 2022


On Tue, 22 Mar 2022 00:05:32 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

> `FileMapInfo` uses `memset` in its constructor to initialize data member, it is generally a bad idea. It can break things badly if adds a new member with a non-trivial constructor and `memset` is not suitable.
> 
> Besides, it leaks malloc'd `_header` member.
> 
> Test:
> 
> - [x]  hotspot_cds
> - [x] tier1
> - [x] tier2
> - [x] runtime/cds/DeterministicDump.java

Friendly ping! Might I get a second review.

Thanks

-------------

PR: https://git.openjdk.java.net/jdk/pull/7899


More information about the hotspot-runtime-dev mailing list