From 0e8fe01d11279b97cbfd03c87e3db0a93943b11b Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 29 Aug 2009 12:45:59 -0500 Subject: [PATCH] change malloc-object and not to be in terms of malloc-array and --- basis/alien/c-types/c-types.factor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index 6b56f52232..8a1b60a0db 100755 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -257,13 +257,16 @@ M: f byte-length drop 0 ; inline heap-size * ; inline deprecated : ( type -- array ) - 1 swap ; inline + heap-size ; inline + +: (c-object) ( type -- array ) + heap-size (byte-array) ; inline : malloc-array ( n type -- alien ) [ heap-size calloc ] [ ] 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 ;