summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 03:02:03 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 03:02:03 +0000
commitc7005118880ceeff65b300479317ca8387ec1246 (patch)
tree8e287463758a55c04270e963cde351d454b03040
parent3477670963c7cc4d929e5196369f5327421ff62d (diff)
* gc.c (garbage_collect_body): use rb_bug() and explicit error message
instead of using assert(). [Bug #9222] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--gc.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d8eccd168..8591c4ef81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Dec 13 12:01:07 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (garbage_collect_body): use rb_bug() and explicit error message
+ instead of using assert().
+ [Bug #9222]
+
Fri Dec 13 11:52:41 2013 Koichi Sasada <ko1@atdot.net>
* array.c: fix comment to remove the word "shady".
diff --git a/gc.c b/gc.c
index d74056bbb2..5eb60e1e96 100644
--- a/gc.c
+++ b/gc.c
@@ -4940,6 +4940,7 @@ garbage_collect_body(rb_objspace_t *objspace, int full_mark, int immediate_sweep
objspace->profile.count++;
objspace->profile.latest_gc_info = reason;
+
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_START, 0 /* TODO: pass minor/immediate flag? */);
objspace->profile.total_allocated_object_num_at_gc_start = objspace->profile.total_allocated_object_num;
@@ -4948,7 +4949,9 @@ garbage_collect_body(rb_objspace_t *objspace, int full_mark, int immediate_sweep
gc_prof_setup_new_record(objspace, reason);
gc_prof_timer_start(objspace);
{
- assert(during_gc > 0);
+ if (during_gc == 0) {
+ rb_bug("during_gc should not be 0. RUBY_INTERNAL_EVENT_GC_START user should not cause GC in events.");
+ }
gc_marks(objspace, full_mark);
gc_sweep(objspace, immediate_sweep);
during_gc = 0;