ffi: Follow example of C_call_scheme; eliminate aborts.
authorMatt Birkholz <matt@birchwood-abbey.net>
Sat, 16 Sep 2017 22:19:27 +0000 (15:19 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Sat, 16 Sep 2017 22:36:53 +0000 (15:36 -0700)
commit00af331a2d86abb600496c0722ad23c3ab1356ad
tree22604be19a1af51494d3f2e77fa75af745d85dbd
parent0c260bae11ec0cb3a08d8cdf792fab642e64ab49
ffi: Follow example of C_call_scheme; eliminate aborts.

Keep callouts simple, fast.  Make callbacks save/restore machine state
(last_return_code, mainly) and use RC_END_OF_COMPUTATION instead of a
special primitive (return-to-c), like C_call_scheme.  Punt the
pop_return_p parameter of Interpret; instead, leave #f in EXP and
Re_Enter_Interpreter, also like C_call_scheme.  Add re_enter_scheme to
pop machine state pushed by abort_to_c (used when state cannot be
saved locally, as in the glib plugin's run_glib).

Add a gc-flip to the test callback.
src/microcode/boot.c
src/microcode/extern.h
src/microcode/interp.c
src/microcode/pruxffi.c
tests/ffi/test-ffi-wrapper.scm