6 Miscellaneous Support
函数
(list->cblock lst type [expect-length]) → cpointer?
lst : list? type : ctype? expect-length : (or/c exact-nonnegative-integer? #f) = #f
If expect-length is not #f and not the same as (length lst), then an exception is raised instead of allocating memory.
函数
(vector->cblock vec type [expect-length]) → cpointer?
vec : vector? type : ctype? expect-length : (or/c exact-nonnegative-integer? #f) = #f
函数
(vector->cpointer vec) → cpointer?
vec : vector?
函数
(flvector->cpointer flvec) → cpointer?
flvec : flvector?
函数
(saved-errno new-value) → void? new-value : exact-integer?
修改于package base的6.4.0.9版本:Added the one-argument variant.
函数
(lookup-errno sym) → (or/c exact-integer? #f)
sym : symbol?
The recognized symbols currently consist of the 81 codes defined by IEEE Std 1003.1, 2013 Edition (also known as POSIX.1), including 'EINTR, 'EEXIST, and 'EAGAIN.
修改于package base的6.6.0.5版本:Relaxed the contract and added support for more symbols.
The conversion is roughly equivalent to
(let ([p (malloc from-type)]) (ptr-set! p from-type v) (ptr-ref p to-type))
If v is a cpointer, (cpointer-gcable? v) is true, and from-type and to-type are both based on _pointer or _gcpointer, then from-type is implicitly converted with _gcable to ensure that the result cpointer is treated as referring to memory that is managed by the garbage collector.
If v is a pointer with an offset component (e.g., from ptr-add), (cpointer-gcable? v) is true, and the result is a cpointer, then the result pointer has the same offset component as v. If (cpointer-gcable? v) is false, then any offset is folded into the pointer base for the result.
函数
(cblock->list cblock type length) → list?
cblock : any/c type : ctype? length : exact-nonnegative-integer?
函数
(cblock->vector cblock type length) → vector?
cblock : any/c type : ctype? length : exact-nonnegative-integer?