is it possible to effect stack allocation of foreign pointers
james anderson
james at dydra.com
Thu Sep 7 15:57:01 UTC 2017
good evening;
> On 2017-09-07, at 16:13, Attila Lendvai <attila at lendvai.name> wrote:
>
>> (let ((lhs-quad (cffi:foreign-slot-value lhs '(:struct liblmdb:val) 'liblmdb:mv-data))
>> (rhs-quad (cffi:foreign-slot-value rhs '(:struct liblmdb:val) 'liblmdb:mv-data)))
>> (declare (dynamic-extent lhs-quad rhs-quad))
>> (%compare-quad lhs-quad rhs-quad)))
>
> try to use (cffi:with-foreign-object (lhs :pointer) …)
the lhs/rhs variables are parameters to the callback.
if i understand your suggestion, you mean the lhs-quad/rhs-quad variables.
this leaves still the question, how to set their value from the respective passed argument structures.
best regards, from berlin,
---
james anderson | james at dydra.com | http://dydra.com
More information about the cffi-devel
mailing list