Common Lisp Package: STATIC-VECTORS

README:

FUNCTION

Public

FILL-FOREIGN-MEMORY (POINTER LENGTH VALUE)

Fill LENGTH octets in foreign memory area POINTER with VALUE.

FREE-STATIC-VECTOR (VECTOR)

Free VECTOR, which must be a vector created by MAKE-STATIC-VECTOR.

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.

REPLACE-FOREIGN-MEMORY (DST-PTR SRC-PTR LENGTH)

Copy LENGTH octets from foreign memory area SRC-PTR to DST-PTR.

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.

Private

STATIC-VECTOR-ADDRESS (VECTOR)

Return a foreign pointer to VECTOR(including its header). VECTOR must be a vector created by MAKE-STATIC-VECTOR.

Undocumented

%%ALLOCATE-STATIC-VECTOR (ALLOCATION-SIZE WIDETAG LENGTH)

%ALLOCATE-STATIC-VECTOR (LENGTH ELEMENT-TYPE)

%ALLOCATION-SIZE (LENGTH WIDETAG N-BITS)

%INITIALIZE-VECTOR (VECTOR INITIAL-ELEMENT INITIAL-ELEMENT-P INITIAL-CONTENTS INITIAL-CONTENTS-P)

CHECK-ARGUMENTS (LENGTH ELEMENT-TYPE INITIAL-ELEMENT INITIAL-ELEMENT-P INITIAL-CONTENTS INITIAL-CONTENTS-P)

CHECK-INITIAL-CONTENTS (LENGTH INITIAL-CONTENTS)

CHECK-INITIAL-ELEMENT (ELEMENT-TYPE INITIAL-ELEMENT)

CHECK-INITIALIZATION-ARGUMENTS (INITIAL-ELEMENT-P INITIAL-CONTENTS-P)

CONSTANTP (FORM &OPTIONAL ENV)

EVAL-CONSTANT (FORM &OPTIONAL ENV)

STATIC-ALLOC (SIZE)

VECTOR-WIDETAG-AND-N-BITS (TYPE)

MACRO

Public

WITH-STATIC-VECTOR ((VAR LENGTH &REST ARGS &KEY (ELEMENT-TYPE ''(UNSIGNED-BYTE 8)) (INITIAL-ELEMENT NIL)) &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.

Private

Undocumented

FREE-VECTOR-IF-ERROR ((VECTOR) &BODY BODY)

THE* (TYPE FORM)

CONSTANT

Private

Undocumented

+ARRAY-HEADER-SIZE+

+SC-PAGESIZE+

+STATIC-VECTORS-ARE-GARBAGE-COLLECTED+

SIZE-OF-SIZE-T