6 Miscellaneous Support
procedure
(list->cblock lst type) → any
lst : list? type : ctype?
procedure
(vector->cblock vec type) → any
vec : vector? type : type?
procedure
(vector->cpointer vec) → cpointer?
vec : vector?
procedure
(flvector->cpointer flvec) → cpointer?
flvec : flvector?
procedure
procedure
(lookup-errno sym) → exact-integer?
sym : (or/c 'EINTR 'EEXIST 'EAGAIN)
The conversion is equivalent to
(let ([p (malloc from-type)]) (ptr-set! p from-type v) (ptr-ref p to-type))
Beware of potential pitfalls with cast:
If v is a pointer that refers to memory that is managed by the garbage collector, from-type and to-type normally should be based on _gcpointer, not _pointer; see also _gcable.
If v is a pointer with an offset component (e.g., from ptr-add), the offset is folded into the pointer base for the result. Consequently, cast generally should not be used on a source pointer that refers to memory that is managed by the garbage collector and that has an offset, unless the memory is specially allocated to allow interior pointers.
procedure
(cblock->list cblock type length) → list?
cblock : any/c type : ctype? length : exact-nonnegative-integer?
procedure
(cblock->vector cblock type length) → vector?
cblock : any/c type : ctype? length : exact-nonnegative-integer?