Skip to content

Commit

Permalink
Make sure the C-API handles are initialized before setting them
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Oct 5, 2012
1 parent fd6fcea commit 880ecc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions vm/capi/handles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace rubinius {
if(needs_gc) {
state->memory()->collect_mature_now = true;
}
atomic::memory_barrier();
return handle;
}

Expand All @@ -27,6 +28,7 @@ namespace rubinius {
if(needs_gc) {
state->memory()->collect_mature_now = true;
}
atomic::memory_barrier();
return handle_index;
}

Expand Down
2 changes: 1 addition & 1 deletion vm/oop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ Object* const cUndef = reinterpret_cast<Object*>(0x22L);
}

void set_handle(STATE, capi::Handle* handle) {
handle_ = handle;
atomic::write(&handle_, handle);
}

unsigned int inc_age() {
Expand Down

0 comments on commit 880ecc3

Please sign in to comment.