RFR: 8273152: Refactor CDS FileMapHeader loading code [v6]

Ioi Lam iklam at openjdk.java.net
Wed Oct 6 17:05:12 UTC 2021


On Wed, 6 Oct 2021 17:01:31 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> Please review,
>>   Refactor fundamental CDS FileMapHeader code for reliable reading of basic info from shared archive.
>>   With the change, it makes it possible to read an archive generated by different version of hotspot. Also it is possible to automatically generate a CDS archive If the archive supplied is not readable or fails to pass the check.
>> 
>>   Tests: tier1-4
>>    jtreg on sa.
>> 
>> Thanks
>> Yumin
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fixed comment for magic check, fixed _file_offset to _header_size

src/hotspot/share/cds/filemap.cpp line 1045:

> 1043: class FileHeaderHelper {
> 1044:   int _fd;
> 1045:   GenericCDSFileMapHeader* _header;

This should be changed to `GenericCDSFileMapHeader _header;`. That way, you don't need to malloc and free it.

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

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


More information about the hotspot-runtime-dev mailing list