RFR: JDK-8260030: Improve stringStream buffer handling [v2]
Thomas Stuefe
stuefe at openjdk.java.net
Thu Jan 21 18:45:38 UTC 2021
On Thu, 21 Jan 2021 14:44:06 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Kim Feedback
>
> Changes requested by kbarrett (Reviewer).
I rewrote stringStream::write somewhat:
- I check and ignore len==0
- I check len for unreasonably high values (>1G). I assert, in release I return: stringStream is used for tracing a lot and we never touch all tracing code in debug. I did not add a overflow check, though I could, since overflow would require very high values for _written (> SIZE_MAX - 1G) which is not possible.
- I changed the guarantee to an assert, and added a similar assert to the start of the function
-------------
PR: https://git.openjdk.java.net/jdk/pull/2160
More information about the hotspot-dev
mailing list