RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v18]

Vladimir Sitnikov vsitnikov at openjdk.org
Sat Dec 30 17:45:56 UTC 2023


On Sat, 30 Dec 2023 17:37:25 GMT, Markus KARG <duke at openjdk.org> wrote:

>> Done. Can we somehow modify the test to make it white-box one? Maybe it's possible to measure memory allocation before and after method invocation in the way that we could use the difference as a proof of non-allocating invocation for trusted OutputStreams?
>
> I assume you mean "to make it a blackbox"? Actually I do not see how we could do that *reliably*, as I already wrote recently.

`com.sun.management.ThreadMXBean#getCurrentThreadAllocatedBytes` is reliable, isn't it?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1438666817


More information about the core-libs-dev mailing list