After light testing and comments from Duane at Franz, this is our
proposed shareable-byte-vector implementation for Allegro.

(defun make-shareable-byte-vector (size)
  "Create a Lisp vector of SIZE bytes which be can passed to 
WITH-POINTER-TO-VECTOR-DATA."
  (make-array size :element-type '(unsigned-byte 8) :allocation 
:static-reclaimable))

(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)))
     ,@body))

It seems to work well.

[...]


_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to