Fork me on GitHub
#graalvm
<
2021-03-18
>
chrisn22:03:14

Is there a known way to convert a long integer into a graal C VoidPointer type?

chrisn22:03:37

My hacking about produced a compiler error and someone has had to do this by now.

borkdude22:03:51

@chris441 You might have some luck asking in the GraalVM slack community

Huahai22:03:39

◦ org.graalvm.word.WordFactory

Huahai22:03:53

static <T extends PointerBase> T pointer(long val) Unsafe conversion from a Java long value to a pointer.

chrisn22:03:55

That won't work at least at the repl.

chrisn22:03:15

It relies on the compiler being loaded...perhaps it will work during compilation though. =

Huahai22:03:32

most things in that C api probably won’t work at repl

Huahai22:03:45

they are mostly word, not object, so not good with clojure

Huahai22:03:55

you will have to wrap them

chrisn23:03:21

Thanks, that is really helpful. Testing it out.