RFR: 8260198: TypeInstPtr::dump2() emits multiple lines if Verbose is set [v6]

Xin Liu xliu at openjdk.java.net
Tue Feb 23 23:18:41 UTC 2021


On Tue, 23 Feb 2021 21:09:15 GMT, Evgeny Astigeevich <github.com+42899633+eastig at openjdk.org> wrote:

>> oh, thanks for the head-up.  I'm happy to remove os::strdup and os::free pair. 
>> it seems that replace_no_expand is cumbersome to do what  tr_delete does.  let me see how it works.
>
>> oh, thanks for the head-up. I'm happy to remove os::strdup and os::free pair.
>> it seems that replace_no_expand is cumbersome to do what tr_delete does. let me see how it works.
> 
> I don't see why it is cumbersome. IMHO, it is logically consistent: replace substring with an empty string without expanding the buffer. The main value is the amount of written code.

oh, by means "cumbersome",  I just felt that it's easier to sweeping chars than substrings in my case.  but I has verified `replace_no_expand(buf, "\n", "")` has the same effect.  I took you advice.  less code is less chance to make mistake. 

Updated this PR. I also verified that it has the same results for `-XX:+Verbose -XX:+PrintIdeal`.

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

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


More information about the hotspot-dev mailing list