]> gitweb.factorcode.org Git - factor.git/commitdiff
change malloc-object and <c-object> not to be in terms of malloc-array and <c-array>
authorJoe Groff <arcata@gmail.com>
Sat, 29 Aug 2009 17:45:59 +0000 (12:45 -0500)
committerJoe Groff <arcata@gmail.com>
Sat, 29 Aug 2009 17:45:59 +0000 (12:45 -0500)
basis/alien/c-types/c-types.factor

index 6b56f52232ff381562037b16ec3409a87fedd34b..8a1b60a0dbebf77051ce327a4a9ce3e297e859a6 100755 (executable)
@@ -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 ;