]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: here, going through the data_root isn't needed
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 23 Nov 2016 07:17:39 +0000 (08:17 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 23 Nov 2016 07:17:39 +0000 (08:17 +0100)
vm/arrays.cpp

index b3d8e698fedcd3b0de1a434d1cce4708da2eb76f..db618a7cec863335aa236ce2d563fa78c56f3a08 100644 (file)
@@ -24,12 +24,12 @@ cell factor_vm::allot_array_4(cell v1_, cell v2_, cell v3_, cell v4_) {
   data_root<object> v2(v2_, this);
   data_root<object> v3(v3_, this);
   data_root<object> v4(v4_, this);
-  data_root<array> a(allot_uninitialized_array<array>(4), this);
-  set_array_nth(a.untagged(), 0, v1.value());
-  set_array_nth(a.untagged(), 1, v2.value());
-  set_array_nth(a.untagged(), 2, v3.value());
-  set_array_nth(a.untagged(), 3, v4.value());
-  return a.value();
+  array *a = allot_uninitialized_array<array>(4);
+  set_array_nth(a, 0, v1.value());
+  set_array_nth(a, 1, v2.value());
+  set_array_nth(a, 2, v3.value());
+  set_array_nth(a, 3, v4.value());
+  return tag<array>(a);
 }
 
 // Allocates memory