コード例 #1
0
void factor_vm::collect_growing_heap(cell requested_size) {
  // Grow the data heap and copy all live objects to the new heap.
  data_heap* old = data;
  set_data_heap(data->grow(&nursery, requested_size));
  collect_mark_impl();
  collect_compact_impl();
  code->flush_icache();
  delete old;
}
コード例 #2
0
ファイル: compaction.cpp プロジェクト: HalfMadDad/factor
void factor_vm::collect_growing_heap(cell requested_size, bool trace_contexts_p)
{
	/* Grow the data heap and copy all live objects to the new heap. */
	data_heap *old = data;
	set_data_heap(data->grow(requested_size));
	collect_mark_impl(trace_contexts_p);
	collect_compact_code_impl(trace_contexts_p);
	code->flush_icache();
	delete old;
}
コード例 #3
0
void factor_vm::collect_compact() {
  collect_mark_impl();
  collect_compact_impl();

  if (data->high_fragmentation_p()) {
    // Compaction did not free up enough memory. Grow the heap.
    set_current_gc_op(collect_growing_heap_op);
    collect_growing_heap(0);
  }

  code->flush_icache();
}
コード例 #4
0
ファイル: compaction.cpp プロジェクト: HalfMadDad/factor
void factor_vm::collect_compact(bool trace_contexts_p)
{
	collect_mark_impl(trace_contexts_p);
	collect_compact_impl(trace_contexts_p);
	
	if(data->high_fragmentation_p())
	{
		/* Compaction did not free up enough memory. Grow the heap. */
		set_current_gc_op(collect_growing_heap_op);
		collect_growing_heap(0,trace_contexts_p);
	}

	code->flush_icache();
}
コード例 #5
0
void factor_vm::collect_full(bool trace_contexts_p)
{
	collect_mark_impl(trace_contexts_p);
	collect_sweep_impl();

	if(data->low_memory_p())
	{
		current_gc->op = collect_growing_heap_op;
		current_gc->event->op = collect_growing_heap_op;
		collect_growing_heap(0,trace_contexts_p);
	}
	else if(data->high_fragmentation_p())
	{
		current_gc->op = collect_compact_op;
		current_gc->event->op = collect_compact_op;
		collect_compact_impl(trace_contexts_p);
	}

	code->flush_icache();
}