diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-06 08:56:59 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-06 08:56:59 -0700 |
commit | d9d8aeb709d25a0b2691ef1bb9e35b8f5f972af2 (patch) | |
tree | b9012c8fe004759ad3a39ce07804107ee1a55f5c /lisplib.c | |
parent | 7880c9b565ab438e1bf0250a967acdbf8d04cb42 (diff) | |
download | txr-d9d8aeb709d25a0b2691ef1bb9e35b8f5f972af2.tar.gz txr-d9d8aeb709d25a0b2691ef1bb9e35b8f5f972af2.tar.bz2 txr-d9d8aeb709d25a0b2691ef1bb9e35b8f5f972af2.zip |
ffi: in function copy flag: fixes two issues.
We have two problems. Firstly, the in handler is being
called on by-value struct and array arguments, and is
wastefully updating the members in the Lisp object.
The second issue is opposite the str type fails to retrieve
the updated string because ffi_freeing_in just frees.
We don't address this issue here, but the groundwork
is laid to fix it in the next commit.
* ffi.c (struct txr_ffi_type *): Add a copy flag argument
to the in virtual function.
(ffi_freeing_in, ffi_ptr_in_in, ffi_ptr_out_in,
(ffi_ptr_out_in, ffi_ptr_out_s_in): Take new copy argument.
Don't pass it down to the recursive in; pass 1.
(ffi_struct_in, ffi_array_in): Take copy argument and pass it
down.
(make_ffi_type_pointer): Type of in parameter updated.
(ffi_call_wrap): Pass 0 to top level in functions.
(ffi_in): Pass to in, so new object is returned.
Diffstat (limited to 'lisplib.c')
0 files changed, 0 insertions, 0 deletions