Handbook
Glossary
memory>byte-array ( alien len -- byte-array )
Factor handbook
»
C library interface
»
Passing data between Factor and C
»
Manual memory management
Prev:
memcpy ( dst src size -- )
Vocabulary
alien
.
data
Inputs
alien
a
c-ptr
len
a non-negative integer
Outputs
byte-array
a
byte-array
Word description
Reads
len
bytes starting from
base
and stores them in a new byte array.
Definition
USING:
byte-arrays
kernel
libc
;
IN:
alien.data
:
memory>byte-array
( alien len -- byte-array )
[
nip
(byte-array)
dup
]
2keep
memcpy
;