/* new objects are allocated here */
VM_C_API zone nursery;
-
-
-
-
cell factorvm::init_zone(zone *z, cell size, cell start)
{
z->size = size;
return z->end;
}
-cell init_zone(zone *z, cell size, cell start)
-{
- return vm->init_zone(z,size,start);
-}
void factorvm::init_card_decks()
{
decks_offset = (cell)data->decks - (start >> deck_bits);
}
-void init_card_decks()
-{
- return vm->init_card_decks();
-}
-
data_heap *factorvm::alloc_data_heap(cell gens, cell young_size,cell aging_size,cell tenured_size)
{
young_size = align(young_size,deck_size);
return data;
}
-data_heap *alloc_data_heap(cell gens, cell young_size,cell aging_size,cell tenured_size)
-{
- return vm->alloc_data_heap(gens,young_size,aging_size,tenured_size);
-}
data_heap *factorvm::grow_data_heap(data_heap *data, cell requested_bytes)
{
new_tenured_size);
}
-data_heap *grow_data_heap(data_heap *data, cell requested_bytes)
-{
- return vm->grow_data_heap(data,requested_bytes);
-}
void factorvm::dealloc_data_heap(data_heap *data)
{
free(data);
}
-void dealloc_data_heap(data_heap *data)
-{
- return vm->dealloc_data_heap(data);
-}
void factorvm::clear_cards(cell from, cell to)
{
memset(first_card,0,last_card - first_card);
}
-void clear_cards(cell from, cell to)
-{
- return vm->clear_cards(from,to);
-}
void factorvm::clear_decks(cell from, cell to)
{
memset(first_deck,0,last_deck - first_deck);
}
-void clear_decks(cell from, cell to)
-{
- return vm->clear_decks(from,to);
-}
void factorvm::clear_allot_markers(cell from, cell to)
{
memset(first_card,invalid_allot_marker,last_card - first_card);
}
-void clear_allot_markers(cell from, cell to)
-{
- return vm->clear_allot_markers(from,to);
-}
void factorvm::reset_generation(cell i)
{
memset((void*)z->start,69,z->size);
}
-void reset_generation(cell i)
-{
- return vm->reset_generation(i);
-}
/* After garbage collection, any generations which are now empty need to have
their allocation pointers and cards reset. */
clear_allot_markers(from,to);
}
-void reset_generations(cell from, cell to)
-{
- return vm->reset_generations(from,to);
-}
void factorvm::set_data_heap(data_heap *data_)
{
clear_allot_markers(data->nursery(),data->tenured());
}
-void set_data_heap(data_heap *data_)
-{
- return vm->set_data_heap(data_);
-}
void factorvm::init_data_heap(cell gens,cell young_size,cell aging_size,cell tenured_size,bool secure_gc_)
{
init_data_gc();
}
-void init_data_heap(cell gens,cell young_size,cell aging_size,cell tenured_size,bool secure_gc_)
-{
- return vm->init_data_heap(gens,young_size,aging_size,tenured_size,secure_gc_);
-}
/* Size of the object pointed to by a tagged pointer */
cell factorvm::object_size(cell tagged)
return untagged_object_size(untag<object>(tagged));
}
-cell object_size(cell tagged)
-{
- return vm->object_size(tagged);
-}
/* Size of the object pointed to by an untagged pointer */
cell factorvm::untagged_object_size(object *pointer)
return align8(unaligned_object_size(pointer));
}
-cell untagged_object_size(object *pointer)
-{
- return vm->untagged_object_size(pointer);
-}
/* Size of the data area of an object pointed to by an untagged pointer */
cell factorvm::unaligned_object_size(object *pointer)
}
}
-cell unaligned_object_size(object *pointer)
-{
- return vm->unaligned_object_size(pointer);
-}
inline void factorvm::vmprim_size()
{
}
}
-cell binary_payload_start(object *pointer)
-{
- return vm->binary_payload_start(pointer);
-}
/* Push memory usage statistics in data heap */
inline void factorvm::vmprim_data_room()
gc_off = true;
}
-void begin_scan()
-{
- return vm->begin_scan();
-}
void factorvm::end_scan()
{
gc_off = false;
}
-void end_scan()
-{
- return vm->end_scan();
-}
inline void factorvm::vmprim_begin_scan()
{
return tag_dynamic(obj);
}
-cell next_object()
-{
- return vm->next_object();
-}
/* Push object at heap scan cursor and advance; pushes f when done */
inline void factorvm::vmprim_next_object()
end_scan();
}
-template<typename TYPE> void each_object(TYPE &functor)
-{
- return vm->each_object(functor);
-}
namespace
{
return accum.words.elements.value();
}
-cell find_all_words()
-{
- return vm->find_all_words();
-}
}
return (cell)pointer >= z->start && (cell)pointer < z->end;
}
-cell init_zone(zone *z, cell size, cell base);
-
-void init_card_decks();
-
-data_heap *grow_data_heap(data_heap *data, cell requested_bytes);
-
-void dealloc_data_heap(data_heap *data);
-
-void clear_cards(cell from, cell to);
-void clear_decks(cell from, cell to);
-void clear_allot_markers(cell from, cell to);
-void reset_generation(cell i);
-void reset_generations(cell from, cell to);
-
-void set_data_heap(data_heap *data_heap_);
-
-void init_data_heap(cell gens,
- cell young_size,
- cell aging_size,
- cell tenured_size,
- bool secure_gc_);
-
/* set up guard pages to check for under/overflow.
size must be a multiple of the page size */
-segment *alloc_segment(cell size);
+segment *alloc_segment(cell size); // defined in OS-*.cpp files PD
void dealloc_segment(segment *block);
-cell untagged_object_size(object *pointer);
-cell unaligned_object_size(object *pointer);
-cell binary_payload_start(object *pointer);
-cell object_size(cell tagged);
-
-void begin_scan();
-void end_scan();
-cell next_object();
-
PRIMITIVE(data_room);
PRIMITIVE(size);
PRIMITIVE(next_object);
PRIMITIVE(end_scan);
-cell find_all_words();
-
-
}
/* new objects are allocated here */