RFR: 8281213: Unsafe uses of long and size_t in MemReporterBase::diff_in_current_scale [v4]

Evgeny Astigeevich eastigeevich at openjdk.org
Wed Jan 11 09:57:22 UTC 2023


On Wed, 11 Jan 2023 02:09:55 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Afshin Zafari has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:
>> 
>>  - 8281213: Unsafe uses of long and size_t in MemReporterBase::diff_in_current_scale
>>  - Merge branch 'master' into _8281213
>>  - 8281213: Unsafe uses of long and size_t in MemReporterBase::diff_in_current_scale
>>  - 8281213: Unsafe uses of long and size_t in MemReporterBase::diff_in_current_scale
>>  - 8281213: Unsafe uses of long and size_t in MemReporterBase::diff_in_current_scale
>>  - 8281213: Unsafe uses of long and size_t in MemReporterBase::diff_in_current_scale
>>  - 8281213: Unsafe uses of long and size_t in MemReporterBase::diff_in_current_scale
>
> src/hotspot/share/services/memReporter.hpp line 91:
> 
>> 89:     }
>> 90: 
>> 91:     if (scaled == 0) {
> 
> I don't think this special case is needed.  It falls out from the generic code, and is likely pretty unusual.

It's not needed because there is the assert above checking it's not 0.

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

PR: https://git.openjdk.org/jdk/pull/11514


More information about the hotspot-runtime-dev mailing list