On Wed, 4 Dec 2024 20:20:16 GMT, Simon Tooke <sto...@openjdk.org> wrote:

>> This is a port of #16301  to macOS.
>> 
>> System.map and System.dump_map are implemented using the macOS API and 
>> provide roughly the same information in the same format. Most of the heavy 
>> lifting was implemented by @tstuefe in 
>> https://github.com/openjdk/jdk/pull/16301 - this PR adds the macOS 
>> implementation and enables the common code for macOS 64 bit.
>> 
>> The System.map tests are also reworked to be cleaner for the three 
>> implementations.
>> 
>> [sample output using 
>> G1GC](https://github.com/user-attachments/files/17558064/g1_map.txt)
>> [sample output using 
>> ZGC](https://github.com/user-attachments/files/17558067/zgc_map.txt)
>
> Simon Tooke has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   fix trailing whitesdpae errors

src/hotspot/os/bsd/memMapPrinter_macosx.cpp line 99:

> 97:     if (valid_share_mode) {
> 98:       int share_mode = rinfo.pri_share_mode;
> 99:       out.print_raw(share_strings[share_mode - 1]);

this makes me nervous. Please do a bounds check beforehand. Assert is fine. Who 
knows if Apple changes the numeric definitions for SM_xxx

src/hotspot/os/bsd/memMapPrinter_macosx.cpp line 107:

> 105: 
> 106: #define X1(TAG, DESCR) X2(TAG, DESCR)
> 107: //#define X1(TAG) case VM_MEMORY_ ## TAG: return # TAG;

remnant?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20953#discussion_r1871824371
PR Review Comment: https://git.openjdk.org/jdk/pull/20953#discussion_r1871820262

Reply via email to