]> gitweb.factorcode.org Git - factor.git/commitdiff
moved arrays.hpp inline functions to vm.hpp
authorPhil Dawes <phil@phildawes.net>
Mon, 17 Aug 2009 20:37:11 +0000 (21:37 +0100)
committerPhil Dawes <phil@phildawes.net>
Wed, 16 Sep 2009 07:16:23 +0000 (08:16 +0100)
vm/arrays.hpp
vm/master.hpp
vm/vm.hpp

index eda30c52fbd8c5dcbc110e352c83c2c3532c43b7..282474ade85ffbc6a8e84d66f3ddd7d166316563 100755 (executable)
@@ -10,21 +10,9 @@ inline cell array_nth(array *array, cell slot)
        return array->data()[slot];
 }
 
-inline void factorvm::set_array_nth(array *array, cell slot, cell value)
-{
-#ifdef FACTOR_DEBUG
-       assert(slot < array_capacity(array));
-       assert(array->h.hi_tag() == ARRAY_TYPE);
-       check_tagged_pointer(value);
-#endif
-       array->data()[slot] = value;
-       write_barrier(array);
-}
 
-inline void set_array_nth(array *array, cell slot, cell value)
-{
-       return vm->set_array_nth(array,slot,value);
-}
+
+
 
 array *allot_array(cell capacity, cell fill);
 
@@ -35,14 +23,5 @@ cell allot_array_4(cell v1, cell v2, cell v3, cell v4);
 PRIMITIVE(array);
 PRIMITIVE(resize_array);
 
-struct growable_array {
-       cell count;
-       gc_root<array> elements;
-
-       growable_array(factorvm *myvm, cell capacity = 10) : count(0), elements(allot_array(capacity,F),myvm) {}
-
-       void add(cell elt);
-       void trim();
-};
 
 }
index c25cbdc3a695f939005f050acbe8741e622c8886..98ed043e05cb7ee0af33d6d8b8902d9e10cf87fa 100755 (executable)
@@ -52,9 +52,9 @@
 #include "data_gc.hpp"
 #include "local_roots.hpp"
 #include "generic_arrays.hpp"
-#include "vm.hpp"
 #include "debug.hpp"
 #include "arrays.hpp"
+#include "vm.hpp"
 #include "strings.hpp"
 #include "booleans.hpp"
 #include "byte_arrays.hpp"
index 8e0c583c5ecd4ca137dc9614128ae8eca1363716..0ccb86b9701a097cdccb1d3c081a7e7f5b33d212 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -902,6 +902,33 @@ template <typename TYPE> TYPE *factorvm::reallot_array(TYPE *array_, cell capaci
        }
 }
 
+//arrays.hpp
+inline void factorvm::set_array_nth(array *array, cell slot, cell value)
+{
+#ifdef FACTOR_DEBUG
+       assert(slot < array_capacity(array));
+       assert(array->h.hi_tag() == ARRAY_TYPE);
+       check_tagged_pointer(value);
+#endif
+       array->data()[slot] = value;
+       write_barrier(array);
+}
+
+inline void set_array_nth(array *array, cell slot, cell value)
+{
+       return vm->set_array_nth(array,slot,value);
+}
+
+struct growable_array {
+       cell count;
+       gc_root<array> elements;
+
+       growable_array(factorvm *myvm, cell capacity = 10) : count(0), elements(allot_array(capacity,F),myvm) {}
+
+       void add(cell elt);
+       void trim();
+};
+
 // next method here: