An experiment with Project Panama: Windows TransmitFile

Pedro Lamarão pedro.lamarao at prodist.com.br
Sun Nov 22 13:27:21 UTC 2020


Horn, thanks for the tip! I added that comment based on a table I saw
somewhere, stating that MemoryAddress is the appropriate carrier. I just
assumed this was a bug. Regards, Pedro.


Em sáb, 21 de nov de 2020 21:55, Jorn Vernee <jorn.vernee at oracle.com>
escreveu:

> Hi Pedro,
>
> For what it's worth [1]:
>
>     final var addressData = MemoryAccess.getAddressAtOffset(address, 32);
> // #TODO: bug: unsupported carrier: MemoryAccess
>
> Can be solved by first creating a `long` VarHandle and then passing it to
> MemoryHandles.asAddressVarHandle [2] to create a var handle that can
> get/set a MemoryAddress.
>
> HTH,
> Jorn
>
> [1] :
> https://github.com/pedrolamarao/sandbox-jvm-sendfile/blob/panama/src/main/java/br/dev/pedrolamarao/sandbox/Program.java#L173
> [2] :
> https://github.com/openjdk/panama-foreign/blob/foreign-abi/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java#L228
> On 21/11/2020 02:27, Pedro Lamarão wrote:
>
> Hello all!
> First and foremost, thank you for your excellent work!
>
> I'd like to contribute an experiment with the foreign linker.
> Maybe evaluating such things is useful somehow.
> It is a program that calls a specialized Windows API to transmit a file
> over a socket.https://github.com/pedrolamarao/sandbox-jvm-sendfile/tree/panama
>
> I think the result is very readable!
> It took me approximately 5 hours to complete this, including studying
> Project Panama's technical documentation.
>
>
>


More information about the panama-dev mailing list