Skip to content

Commit 1eb8746

Browse files
committed
FFM : add note about upcalls
1 parent 8f62f26 commit 1eb8746

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

docs/ffm.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ JF approach is to use JNI to pin arrays to avoid the excess copying back and for
1212

1313
Maybe the Valhalla project and value types may offer better performance in the future but still have no idea how Valhalla will work with the native systems (FFM/JNI).
1414
See valhalla.txt for more info.
15+
16+
Notes:
17+
- FFM upcalls (allows C code to call Java) are somewhat expensive so instead of creating them for each native invocation static upcalls are used instead
18+
- in order for static upcalls to call virtual methods ThreadLocal storage is used to track which object invoked the native method
19+
- one caveat to this is that callback methods can NOT call another native method

0 commit comments

Comments
 (0)