[cffi-devel] shareable-byte-vectors for Allegro

John Fremlin jf at msi.co.jp
Tue Jan 13 08:05:50 UTC 2009


Any idea how safe or not this is? I am going to ask support at Franz.

(defun make-shareable-byte-vector (size)
  "Create a Lisp vector of SIZE bytes can passed to
;WITH-POINTER-TO-VECTOR-DATA."
  (ff:allocate-fobject :unsigned-char :lisp size))
;
(defmacro with-pointer-to-vector-data ((ptr-var vector) &body body)
  "Bind PTR-VAR to a foreign pointer to the data in VECTOR."
  `(let ((,ptr-var (ff:fslot-address-typed :unsigned-char :lisp ,vector)))
     , at body))




More information about the cffi-devel mailing list