]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/struct-arrays/struct-arrays.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / basis / struct-arrays / struct-arrays.factor
index 390a03455d75d63066bf4f30fc2a56a17993f7f8..53815c7da4f052b0f7b4570eff9e91b53b9253c2 100755 (executable)
@@ -66,6 +66,9 @@ ERROR: bad-byte-array-length byte-array ;
         [ drop bad-byte-array-length ] unless
     ] keep <direct-struct-array> ; inline
 
+: struct-array-on ( struct length -- struct-array )
+    [ [ >c-ptr ] [ class ] bi ] dip swap <direct-struct-array> ; inline    
+
 : malloc-struct-array ( length c-type -- struct-array )
     [ heap-size calloc ] 2keep <direct-struct-array> ; inline