Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into 1.8.7
Browse files Browse the repository at this point in the history
Conflicts:
	rakelib/release.rb
brixen committed May 18, 2015
2 parents fe57222 + a0f2fa5 commit 2690e3e
Showing 8 changed files with 12 additions and 59 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
daedalus-core (0.3.0)
daedalus-core (0.5.0)
rake (10.4.2)
redcard (1.1.0)
rubinius-ast (1.3.0)
2 changes: 1 addition & 1 deletion kernel/bootstrap/thread.rb
Original file line number Diff line number Diff line change
@@ -273,7 +273,7 @@ def alive?
end

def stop?
!alive? || @sleep
!alive? || sleeping?
end

def sleeping?
2 changes: 1 addition & 1 deletion vm/environment.cpp
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ namespace rubinius {
delete finalizer_thread_;

VM::discard(state, root_vm);
SharedState::discard(shared);
delete shared;
delete state;

for(int i = 0; i < argc_; i++) {
19 changes: 0 additions & 19 deletions vm/shared_state.cpp
Original file line number Diff line number Diff line change
@@ -58,8 +58,6 @@ namespace rubinius {
, username("")
, pid("")
{
ref();

internal_threads_ = new InternalThreads();

for(int i = 0; i < Primitives::cTotalPrimitives; i++) {
@@ -96,26 +94,12 @@ namespace rubinius {
delete internal_threads_;
}

void SharedState::add_managed_thread(ManagedThread* thr) {
SYNC_TL;
threads_.push_back(thr);
}

void SharedState::remove_managed_thread(ManagedThread* thr) {
SYNC_TL;
threads_.remove(thr);
}

int SharedState::size() {
return sizeof(SharedState) +
sizeof(WorldState) +
symbols.bytes_used();
}

void SharedState::discard(SharedState* ss) {
if(ss->deref()) delete ss;
}

uint32_t SharedState::new_thread_id() {
return atomic::fetch_and_add(&thread_ids_, 1);
}
@@ -131,8 +115,6 @@ namespace rubinius {
VM* vm = new VM(id, *this);
threads_.push_back(vm);

this->ref();

// If there is no root vm, then the first one created becomes it.
if(!root_vm_) root_vm_ = vm;
return vm;
@@ -141,7 +123,6 @@ namespace rubinius {
void SharedState::remove_vm(VM* vm) {
SYNC_TL;
threads_.remove(vm);
this->deref();

// Don't delete ourself here, it's too problematic.
}
8 changes: 1 addition & 7 deletions vm/shared_state.hpp
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@

#include "config.h"

#include "util/refcount.hpp"
#include "gc/variable_buffer.hpp"
#include "gc/root_buffer.hpp"
#include "kcode.hpp"
@@ -88,7 +87,7 @@ namespace rubinius {
* single process.
*/

class SharedState : public RefCount, public Lockable {
class SharedState : public Lockable {
private:
InternalThreads* internal_threads_;
SignalThread* signal_thread_;
@@ -157,8 +156,6 @@ namespace rubinius {
SharedState(Environment* env, Configuration& config, ConfigParser& cp);
~SharedState();

static void discard(SharedState* ss);

int size();

void set_initialized() {
@@ -195,9 +192,6 @@ namespace rubinius {

Array* vm_threads(STATE);

void add_managed_thread(ManagedThread* thr);
void remove_managed_thread(ManagedThread* thr);

int global_serial() const {
return global_serial_;
}
9 changes: 8 additions & 1 deletion vm/test/test.hpp
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
#include "configuration.hpp"
#include "metrics.hpp"
#include "vm/detection.hpp"
#include "vm/gc/immix_marker.hpp"

#include <cxxtest/TestSuite.h>

@@ -30,8 +31,14 @@ class VMTest {
}

void destroy() {
if(ObjectMemory* om = state->memory()) {
if(ImmixMarker* im = om->immix_marker()) {
im->stop(state);
}
}

VM::discard(state, state->vm());
SharedState::discard(shared);
delete shared;
delete state;
}

28 changes: 0 additions & 28 deletions vm/util/refcount.hpp

This file was deleted.

1 change: 0 additions & 1 deletion vm/vm.hpp
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
#include "gc/managed.hpp"
#include "vm_thread_state.hpp"

#include "util/refcount.hpp"
#include "util/thread.hpp"

#include "gc/variable_buffer.hpp"

0 comments on commit 2690e3e

Please sign in to comment.