All Manuals > LispWorks User Guide and Reference Manual > 49 The SYSTEM Package

NextPrevUpTopContentsIndex

make-typed-aref-vector

Function
Summary

Makes a vector that can be accessed efficiently.

Package

system

Signature

make-typed-aref-vector byte-length => vector

Arguments

byte-length

A non-negative fixnum.

Values

vector

A vector.

Description

The function make-typed-aref-vector returns a vector which is suitable for efficient access at compiler optimization level safety = 0.

byte-length is measured in 8-bit bytes.

Use typed-aref to access vector efficiently.

Notes

Declaring the result of make-typed-aref-vector as cl:dynamic-extent causes it to allocate the array on the stack (in LispWorks 7.0 and later versions).

Examples

To make a typed vector of the type (unsigned-byte 32) or single-float with length 10:

(make-typed-aref-vector (* 10 4))

To make a typed vector of the type double-float with length 10:

(make-typed-aref-vector (* 10 8))
See also

typed-aref
Optimized integer arithmetic and integer vector access


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex