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);
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();
-};
}
#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"
}
}
+//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: