delete malloc-file-contents 'cause it sucks and nobody likes it
parent
dd691a61e8
commit
3a1bb22618
|
@ -56,7 +56,6 @@ $nl
|
||||||
{ $subsections
|
{ $subsections
|
||||||
malloc-object
|
malloc-object
|
||||||
malloc-byte-array
|
malloc-byte-array
|
||||||
malloc-file-contents
|
|
||||||
}
|
}
|
||||||
"The " { $vocab-link "libc" } " vocabulary defines several words which directly call C standard library memory management functions:"
|
"The " { $vocab-link "libc" } " vocabulary defines several words which directly call C standard library memory management functions:"
|
||||||
{ $subsections
|
{ $subsections
|
||||||
|
|
|
@ -56,9 +56,6 @@ M: word <c-direct-array>
|
||||||
: malloc-string ( string encoding -- alien )
|
: malloc-string ( string encoding -- alien )
|
||||||
string>alien malloc-byte-array ;
|
string>alien malloc-byte-array ;
|
||||||
|
|
||||||
: malloc-file-contents ( path -- alien len )
|
|
||||||
binary file-contents [ malloc-byte-array ] [ length ] bi ;
|
|
||||||
|
|
||||||
M: memory-stream stream-read
|
M: memory-stream stream-read
|
||||||
[
|
[
|
||||||
[ index>> ] [ alien>> ] bi <displaced-alien>
|
[ index>> ] [ alien>> ] bi <displaced-alien>
|
||||||
|
@ -81,3 +78,4 @@ M: value-type c-type-setter ( type -- quot )
|
||||||
[ c-type-getter ] [ c-type-unboxer-quot ] [ heap-size ] tri
|
[ c-type-getter ] [ c-type-unboxer-quot ] [ heap-size ] tri
|
||||||
'[ @ swap @ _ memcpy ] ;
|
'[ @ swap @ _ memcpy ] ;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue