An experiment with Project Panama: Windows TransmitFile
Jorn Vernee
jorn.vernee at oracle.com
Sun Nov 22 00:55:21 UTC 2020
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