change malloc-object and <c-object> not to be in terms of malloc-array and <c-array>
parent
64baa58a3d
commit
0e8fe01d11
|
@ -257,13 +257,16 @@ M: f byte-length drop 0 ; inline
|
|||
heap-size * <byte-array> ; inline deprecated
|
||||
|
||||
: <c-object> ( type -- array )
|
||||
1 swap <c-array> ; inline
|
||||
heap-size <byte-array> ; inline
|
||||
|
||||
: (c-object) ( type -- array )
|
||||
heap-size (byte-array) ; inline
|
||||
|
||||
: malloc-array ( n type -- alien )
|
||||
[ heap-size calloc ] [ <c-type-direct-array> ] 2bi ; inline
|
||||
|
||||
: malloc-object ( type -- alien )
|
||||
1 swap malloc-array ; inline
|
||||
heap-size malloc ; inline
|
||||
|
||||
: malloc-byte-array ( byte-array -- alien )
|
||||
dup byte-length [ nip malloc dup ] 2keep memcpy ;
|
||||
|
|
Loading…
Reference in New Issue