コード例 #1
0
ファイル: gc.cpp プロジェクト: inforichland/factor-id3
void factor_vm::primitive_disable_gc_events()
{
	if(gc_events)
	{
		growable_array result(this);

		std::vector<gc_event> *gc_events = this->gc_events;
		this->gc_events = NULL;

		std::vector<gc_event>::const_iterator iter = gc_events->begin();
		std::vector<gc_event>::const_iterator end = gc_events->end();

		for(; iter != end; iter++)
		{
			gc_event event = *iter;
			byte_array *obj = byte_array_from_value(&event);
			result.add(tag<byte_array>(obj));
		}

		result.trim();
		dpush(result.elements.value());

		delete this->gc_events;
	}
	else
		dpush(false_object);
}
コード例 #2
0
ファイル: gc.cpp プロジェクト: ForNeVeR/factor
/* XXX: Remember that growable_array has a data_root already */
void factor_vm::primitive_disable_gc_events() {
  if (gc_events) {
    growable_array result(this);

    std::vector<gc_event>* gc_events = this->gc_events;
    this->gc_events = NULL;

    FACTOR_FOR_EACH(*gc_events) {
      gc_event event = *iter;
      byte_array* obj = byte_array_from_value(&event);
      result.add(tag<byte_array>(obj));
    }

    result.trim();
    ctx->push(result.elements.value());

    delete this->gc_events;
  } else
コード例 #3
0
ファイル: code_heap.cpp プロジェクト: 8byte-jose/factor
void factor_vm::primitive_code_room()
{
	code_heap_room room = code_room();
	ctx->push(tag<byte_array>(byte_array_from_value(&room)));
}
コード例 #4
0
ファイル: callbacks.cpp プロジェクト: user8811/factor
/* Allocates memory */
void factor_vm::primitive_callback_room() {
  allocator_room room = callbacks->allocator->as_allocator_room();
  ctx->push(tag<byte_array>(byte_array_from_value(&room)));
}
コード例 #5
0
ファイル: data_heap.cpp プロジェクト: I-I/FactorLanguageBuild
void factor_vm::primitive_data_room()
{
	data_heap_room room = data_room();
	ctx->push(tag<byte_array>(byte_array_from_value(&room)));
}