Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Temporarily disable running Ruby finalizers.

  • Loading branch information...
commit e5c2724636d7a337c26a227cbea00957852407f1 1 parent 8dbc49d
@brixen brixen authored
Showing with 47 additions and 27 deletions.
  1. +25 −15 vm/finalizer.cpp
  2. +22 −12 vm/objectmemory.cpp
View
40 vm/finalizer.cpp
@@ -104,8 +104,6 @@ namespace rubinius {
state->vm()->thread->hard_unlock(state, gct);
- CallFrame* call_frame = 0;
-
while(!exit_) {
FinalizeObject* fi;
@@ -125,19 +123,32 @@ namespace rubinius {
}
state->vm()->set_call_frame(0);
- if(fi->ruby_finalizer) {
- // Rubinius specific code. If the finalizer is cTrue, then
- // send the object the finalize message
- if(fi->ruby_finalizer == cTrue) {
- fi->object->send(state, call_frame, state->symbol("__finalize__"));
- } else {
- Array* ary = Array::create(state, 1);
- ary->set(state, 0, fi->object->id(state));
-
- OnStack<1> os(state, ary);
- fi->ruby_finalizer->send(state, call_frame, G(sym_call), ary);
- }
+ if(fi->ruby_finalizer) {
+ /*
+ * TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
+ * TODO
+ * TODO Temporarily disabling running Ruby finalizers until issues
+ * TODO can be resolved. Yes, this will cause memory leaks. Memory
+ * TODO leaks are better than segfaults.
+ * TODO
+ * TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
+ */
+
+ // CallFrame* call_frame = 0;
+
+ // // Rubinius specific code. If the finalizer is cTrue, then
+ // // send the object the finalize message
+ // if(fi->ruby_finalizer == cTrue) {
+ // fi->object->send(state, call_frame, state->symbol("__finalize__"));
+ // } else {
+ // Array* ary = Array::create(state, 1);
+ // ary->set(state, 0, fi->object->id(state));
+
+ // OnStack<1> os(state, ary);
+
+ // fi->ruby_finalizer->send(state, call_frame, G(sym_call), ary);
+ // }
}
if(fi->finalizer) {
@@ -157,7 +168,6 @@ namespace rubinius {
fi->status = FinalizeObject::eFinalized;
}
-
}
void FinalizerHandler::schedule(FinalizeObject* fi) {
View
34 vm/objectmemory.cpp
@@ -988,18 +988,28 @@ namespace rubinius {
if(fi.finalizer) {
(*fi.finalizer)(state, fi.object);
} else if(fi.ruby_finalizer) {
- // Rubinius specific code. If the finalizer is cTrue, then
- // send the object the finalize message
- if(fi.ruby_finalizer == cTrue) {
- fi.object->send(state, 0, state->symbol("__finalize__"));
- } else {
- Array* ary = Array::create(state, 1);
- ary->set(state, 0, fi.object->id(state));
-
- OnStack<1> os(state, ary);
-
- fi.ruby_finalizer->send(state, 0, G(sym_call), ary);
- }
+ /*
+ * TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
+ * TODO
+ * TODO Temporarily disabling running Ruby finalizers until issues
+ * TODO can be resolved. Yes, this will cause memory leaks. Memory
+ * TODO leaks are better than segfaults.
+ * TODO
+ * TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
+ */
+
+ // // Rubinius specific code. If the finalizer is cTrue, then
+ // // send the object the finalize message
+ // if(fi.ruby_finalizer == cTrue) {
+ // fi.object->send(state, 0, state->symbol("__finalize__"));
+ // } else {
+ // Array* ary = Array::create(state, 1);
+ // ary->set(state, 0, fi.object->id(state));
+
+ // OnStack<1> os(state, ary);
+
+ // fi.ruby_finalizer->send(state, 0, G(sym_call), ary);
+ // }
} else {
std::cerr << "During shutdown, unsupported object to be finalized: "
<< fi.object->to_s(state)->c_str(state) << std::endl;
Please sign in to comment.
Something went wrong with that request. Please try again.