Created
November 28, 2012 06:49
-
-
Save mrkn/4159481 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/gc.c b/gc.c | |
index 63869a0..e15f141 100644 | |
--- a/gc.c | |
+++ b/gc.c | |
@@ -1420,9 +1420,11 @@ finalize_list(rb_objspace_t *objspace, RVALUE *p) | |
RVALUE *tmp = p->as.free.next; | |
run_final(objspace, (VALUE)p); | |
if (!FL_TEST(p, FL_SINGLETON)) { /* not freeing page */ | |
- add_slot_local_freelist(objspace, p); | |
- if (!is_lazy_sweeping(objspace)) { | |
- gc_prof_dec_live_num(objspace); | |
+ if ((VALUE)p != rb_thread_main()) { | |
+ add_slot_local_freelist(objspace, p); | |
+ if (!is_lazy_sweeping(objspace)) { | |
+ gc_prof_dec_live_num(objspace); | |
+ } | |
} | |
} | |
else { | |
@@ -1458,7 +1460,8 @@ chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg) | |
{ | |
RVALUE *p = (RVALUE *)key, **final_list = (RVALUE **)arg; | |
if ((p->as.basic.flags & FL_FINALIZE) == FL_FINALIZE && | |
- !MARKED_IN_BITMAP(GET_HEAP_BITMAP(p), p)) { | |
+ !MARKED_IN_BITMAP(GET_HEAP_BITMAP(p), p) && | |
+ (VALUE)p != rb_thread_main()) { | |
if (BUILTIN_TYPE(p) != T_ZOMBIE) { | |
p->as.free.flags = T_ZOMBIE; | |
RDATA(p)->dfree = 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment