Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3f30d508a7e6
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2558f2bf0c09
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on May 2, 2015

  1. Copy the full SHA
    8d06bc2 View commit details
  2. Copy the full SHA
    2558f2b View commit details
Showing with 10 additions and 4 deletions.
  1. +10 −4 vm/builtin/array.cpp
14 changes: 10 additions & 4 deletions vm/builtin/array.cpp
Original file line number Diff line number Diff line change
@@ -190,11 +190,17 @@ namespace rubinius {
}

native_int new_size = size() + osize;
Tuple* nt = Tuple::create(state, new_size);
nt->copy_from(state, tuple_, start_, total_, Fixnum::from(0));
nt->copy_from(state, other->tuple(), other->start(), other->total(), total_);
if(new_size <= tuple_->num_fields()) {
// There is enough space in the current tuple, so just copy into it.
tuple_->copy_from(state, other->tuple(), other->start(), other->total(), total_);
} else {
// We need to create a bigger tuple, then copy both tuples into it.
Tuple* nt = Tuple::create_dirty(state, new_size);
nt->copy_from(state, tuple_, start_, total_, Fixnum::from(0));
nt->copy_from(state, other->tuple(), other->start(), other->total(), total_);
tuple(state, nt);
}

tuple(state, nt);
start(state, Fixnum::from(0));
total(state, Fixnum::from(new_size));