updated webrev (with fixing utf8 buffer size in transport.c):
http://cr.openjdk.java.net/~amenkov/jdk15/jdwp_javalib_dep/webrev.2/
On 05/23/2020 01:54, Alan Bateman wrote:
On 23/05/2020 01:15, Alex Menkov wrote:
size of utf8 string does not depend on sizeof(int).
Per RFC each symbol can be encoded by 1..4 byte(s).
Maybe Alan can explain this len+len/2+2 value.
I don't know without digging into the history. My only reason for
pointing it out is that it looked curious as I would have expected len*4
+ 1. The lack of parentheses will also force every reader to stop and
remind themselves of the precedence rules. I don't want to hold up
JDK-8244703, I was spotted it when checking for other usages of
utf8FromPlatform.
Not a problem, I think it would be good to fix this right now.
--alex
-Alan