Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
/* 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
Ejemplo n.º 3
0
void factor_vm::primitive_code_room()
{
	code_heap_room room = code_room();
	ctx->push(tag<byte_array>(byte_array_from_value(&room)));
}
Ejemplo n.º 4
0
/* 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)));
}
Ejemplo n.º 5
0
void factor_vm::primitive_data_room()
{
	data_heap_room room = data_room();
	ctx->push(tag<byte_array>(byte_array_from_value(&room)));
}