I had a look at the definitions of these two functions. Right now in cffi-ecl.lisp it seems that they are only called with basic types, for they call cffi-type->ecl-type which only deals with things like integers, doubles, etc.<br>
<br>Could I just produce a compiler macro that relies on this? The result would be much much simpler than this as it could be inlined and make use of ECL's embedded C statements.<br><br>Actually it would be nice if instead of a compiler macro I could define them to be just plain macros. Anything that prevents it?<br>
<br>Juanjo<br><br>(defun %mem-ref (ptr type &optional (offset 0))<br> "Dereference an object of TYPE at OFFSET bytes from PTR."<br> (let* ((type (cffi-type->ecl-type type))<br> (type-size (ffi:size-of-foreign-type type)))<br>
(si:foreign-data-ref-elt<br> (si:foreign-data-recast ptr (+ offset type-size) :void) offset type)))<br clear="all"><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://tream.dreamhosters.com">http://tream.dreamhosters.com</a><br>