Implement allocate-nm-vector.
authorChris Hanson <org/chris-hanson/cph>
Wed, 12 Apr 2017 04:46:38 +0000 (21:46 -0700)
committerChris Hanson <org/chris-hanson/cph>
Wed, 12 Apr 2017 04:46:38 +0000 (21:46 -0700)
src/microcode/vector.c

index ccb99d3a5ce52c391a955f7d12ce0037ed9684e8..b2ad7f2cf2b6323427cedaa7c2c801ca09079dc2 100644 (file)
@@ -93,6 +93,15 @@ make_vector (unsigned long length, SCHEME_OBJECT contents, bool gc_check_p)
   }
 }
 \f
+DEFINE_PRIMITIVE ("ALLOCATE-NM-VECTOR", Prim_allocate_nm_vector, 2, 2, 0)
+{
+  PRIMITIVE_HEADER (2);
+  PRIMITIVE_RETURN
+    (allocate_non_marked_vector ((arg_ulong_index_integer (1, N_TYPE_CODES)),
+                                 (arg_ulong_index_integer (2, (1UL << DATUM_LENGTH))),
+                                 true));
+}
+
 DEFINE_PRIMITIVE ("VECTOR-CONS", Prim_vector_cons, 2, 2, 0)
 {
   PRIMITIVE_HEADER (2);