From 33ecaa5010631ac0c834e0996c22d05ebdbb070b Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Mon, 17 Aug 2009 21:37:10 +0100 Subject: [PATCH] moved arrays.hpp functions to vm --- vm/arrays.hpp | 10 ++++++++-- vm/vm.hpp | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/vm/arrays.hpp b/vm/arrays.hpp index ab4ad61a71..eda30c52fb 100755 --- a/vm/arrays.hpp +++ b/vm/arrays.hpp @@ -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); diff --git a/vm/vm.hpp b/vm/vm.hpp index 7c657ff9e4..0389817bb9 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -213,7 +213,6 @@ struct factorvm { template T *allot_array_internal(cell capacity); template bool reallot_array_in_place_p(T *array, cell capacity); template 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);