change malloc-object and <c-object> not to be in terms of malloc-array and <c-array>

db4
Joe Groff 2009-08-29 12:45:59 -05:00
parent 64baa58a3d
commit 0e8fe01d11
1 changed files with 5 additions and 2 deletions

View File

@ -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 ;