4 ms·
This is interesting and a nice thing to have built into the JVM. It seems to me though that SubstrateVM[1] makes calling native functions even easier (from pag
by naruhodo 4y ago
This is interesting and a nice thing to have built into the JVM.
It seems to me though that SubstrateVM[1] makes calling native functions even easier (from page 8 of the slides):
// C:
struct timespec {
__time_t tv_sec;
__syscall_slong_t tv_nsec;
};
int clock_gettime(clockid_t __clock_id, struct timespec *__tp)
// Java:
@CStruct interface timespec extends PointerBase {
@CField long tv_sec();
@CField long tv_nsec();
}
@CFunction static native int clock_gettime(int clock_id, timespec tp);
[1]: https://www.complang.tuwien.ac.at/lehre/ubvo/substrate.pdf https://www.complang.tuwien.ac.at/lehre/ubvo/substrate.pdf