diff --git a/vm/arrays.hpp b/vm/arrays.hpp index eda30c52fb..282474ade8 100755 --- a/vm/arrays.hpp +++ b/vm/arrays.hpp @@ -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 elements; - - growable_array(factorvm *myvm, cell capacity = 10) : count(0), elements(allot_array(capacity,F),myvm) {} - - void add(cell elt); - void trim(); -}; } diff --git a/vm/master.hpp b/vm/master.hpp index c25cbdc3a6..98ed043e05 100755 --- a/vm/master.hpp +++ b/vm/master.hpp @@ -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" diff --git a/vm/vm.hpp b/vm/vm.hpp index 8e0c583c5e..0ccb86b970 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -902,6 +902,33 @@ template 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 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: