moved arrays.hpp inline functions to vm.hpp
parent
2e129dfc45
commit
209755e2de
|
@ -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();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
27
vm/vm.hpp
27
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:
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue