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

index ab4ad61a71a60dafeb9e5195f8e15dbb45f01b7b..eda30c52fbd8c5dcbc110e352c83c2c3532c43b7 100755 (executable)
@@ -1,6 +1,7 @@
 namespace factor
 {
-inline static cell array_nth(array *array, cell slot)
+
+inline cell array_nth(array *array, cell slot)
 {
 #ifdef FACTOR_DEBUG
        assert(slot < array_capacity(array));
@@ -9,7 +10,7 @@ inline static cell array_nth(array *array, cell slot)
        return array->data()[slot];
 }
 
-inline static void set_array_nth(array *array, cell slot, cell value)
+inline void factorvm::set_array_nth(array *array, cell slot, cell value)
 {
 #ifdef FACTOR_DEBUG
        assert(slot < array_capacity(array));
@@ -20,6 +21,11 @@ inline static void set_array_nth(array *array, cell slot, cell 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);
 
 cell allot_array_1(cell obj);
index 7c657ff9e473cc65e2091cde9151eeacd334d6ff..0389817bb9f85dd310b3d29f5937c4fd4b7b3776 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -213,7 +213,6 @@ struct factorvm {
        template <typename T> T *allot_array_internal(cell capacity);
        template <typename T> bool reallot_array_in_place_p(T *array, cell capacity);
        template <typename TYPE> TYPE *reallot_array(TYPE *array_, cell capacity);
-       // next method here:
 
        //debug
        void print_chars(string* str);
@@ -246,6 +245,8 @@ struct factorvm {
        cell allot_array_2(cell v1_, cell v2_);
        cell allot_array_4(cell v1_, cell v2_, cell v3_, cell v4_);
        inline void vmprim_resize_array();
+       inline void set_array_nth(array *array, cell slot, cell value);
+       // next method here:
 
        //strings
        cell string_nth(string* str, cell index);