RFR: 8299518: HotSpotVirtualMachine shared code across different platforms [v3]
David Holmes
dholmes at openjdk.org
Fri Jan 6 05:52:51 UTC 2023
On Thu, 5 Jan 2023 11:47:56 GMT, Yi Yang <yyang at openjdk.org> wrote:
>> Looks like Windows needs a long fd so the shared API takes long and we then cast to int for the Unix native methods. A little messy but fixable.
>
>> If you add read/close methods for Windows that then call readPipe/closePipe, then we don't need to subclass and override.
>
> Sorry, I don't understand what this means. VirtualMachineImpl is platform-dependent while HotSpotVirtualMachine is shared, we always need to sub-class socket input stream in order to call platform-depend read/close.
As long as all the platform-specific `VirtualMachineImpl` classes define a `read` and `close` method then we can simply have the shared socket stream class call those methods. Windows will need an extra level of indirection because its `read` method will have to call `readPipe`.
-------------
PR: https://git.openjdk.org/jdk/pull/11823
More information about the serviceability-dev
mailing list