Ejemplo n.º 1
0
  memory::Address copy(memory::Address original, immix::Allocator& alloc) {
    memory::Address copy_addr = alloc.allocate(sizeof(SimpleObject));
    SimpleObject* copy = copy_addr.as<SimpleObject>();
    SimpleObject* orig = original.as<SimpleObject>();

    copy->fwd = 0;
    copy->magic = orig->magic;
    copy->sub = orig->sub;

    return copy;
  }
Ejemplo n.º 2
0
  memory::Address ImmixGC::ObjectDescriber::copy(memory::Address original,
      immix::Allocator& alloc) {
    Object* orig = original.as<Object>();

    memory::Address copy_addr = alloc.allocate(
        orig->size_in_bytes(object_memory_->state()));

    Object* copy = copy_addr.as<Object>();

    copy->initialize_full_state(object_memory_->state(), orig, 0);

    copy->set_zone(MatureObjectZone);
    copy->set_in_immix();

    return copy_addr;
  }
Ejemplo n.º 3
0
  immix::Address ImmixGC::ObjectDescriber::copy(immix::Address original,
      immix::Allocator& alloc) {
    Object* orig = original.as<Object>();

    immix::Address copy_addr = alloc.allocate(
        orig->size_in_bytes(object_memory_->state));

    Object* copy = copy_addr.as<Object>();

    copy->initialize_copy(orig, 0);
    copy->copy_body(object_memory_->state, orig);

    copy->zone = MatureObjectZone;
    copy->set_in_immix();

    return copy_addr;
  }