Immediately after switching the page, it will work with CSR.
Please reload your browser to see how it works.
Every ffi example I've found seem to operate on the assumption that you want to invoke syscalls or libc, which (with possibly the exception of like madvise and aioring) Java already mostly has decent facilities to interact with even without native calls.
In C# I can just do something like this conceptual code:
```
// FILE *fopen(const char *filename, const char *mode)
[DllImport("libc")] public unsafe extern nint fopen([MarshalAs(UnmanagedType.LPStr)] string filename, [MarshalAs(UnmanagedType.LPStr)] string mode);
// char *fgets(char *str, int n, FILE *stream)
[DllImport("libc")] public unsafe extern nint fgets([MarshalAs(UnmanagedType.LPStr)] string str, int n, nint stream);
// int fclose(FILE *stream)
[DllImport("libc")] public unsafe extern int fclose(nint stream);
```
So much less code, and so much more precise than any of the Java JNI and FFI stuff.
Very useful, especially the prebundled platform bindings.
I have bundled shared libraries for five or six platforms in a java library that needs to make syscalls. It works but it is a pain if anything ever changes or a new platform needs to be brought up. Checking in binaries always feels icky but is necessary if not all targets can be built on a single machine.
The problem with the new api is that people upgrade java very slowly in most contexts. For an oss library developer, I see very little value add in this feature because I'm still stuck for all of my users who are using an older version of java. If I integrate the new ffi api, now I have to support both it and the jni api.