static-vectors

API Reference

static-vectors

Create vectors allocated in static memory.

STATIC-VECTORS

  • Function FILL-FOREIGN-MEMORY (pointer length value)
    Fill LENGTH octets in foreign memory area POINTER with VALUE.
  • Function REPLACE-FOREIGN-MEMORY (dst-ptr src-ptr length)
    Copy LENGTH octets from foreign memory area SRC-PTR to DST-PTR.
  • Function STATIC-VECTOR-POINTER (vector &key (offset 0))
    Return a foreign pointer to the beginning of VECTOR + OFFSET octets. VECTOR must be a vector created by MAKE-STATIC-VECTOR.
  • Function FREE-STATIC-VECTOR (vector)
    Free VECTOR, which must be a vector created by MAKE-STATIC-VECTOR.
  • Macro WITH-STATIC-VECTOR ((var length &rest args &key (element-type '(unsigned-byte 8)) initial-contents initial-element) &body body)
    Bind PTR-VAR to a static vector of length LENGTH and execute BODY within its dynamic extent. The vector is freed upon exit.
  • Function MAKE-STATIC-VECTOR (length &key (element-type '(unsigned-byte 8)) (initial-element nil initial-element-p) (initial-contents nil initial-contents-p))
    Create a simple vector of length LENGTH and type ELEMENT-TYPE which will not be moved by the garbage collector. The vector might be allocated in foreign memory so you must always call FREE-STATIC-VECTOR to free it.
  • Macro WITH-STATIC-VECTORS (((var length &rest args) &rest more-clauses) &body body)
    Allocate multiple static vectors at once.
  • Cffi-Type STATIC-VECTOR