summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-27 02:49:08 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-27 02:49:08 +0000
commitc4fe5260114482143943bead5b68a628a047c863 (patch)
tree0bfda39dd0e24c4480e75b258b87e902120be8c5 /gc.c
parent0805d73f650ee03ba03b9892a0a85f6de289a82c (diff)
* gc.c (gc_profile_clear): do rest_sweep() before clearing
profile.current_record. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 2d469cfcdf..0c8069ea40 100644
--- a/gc.c
+++ b/gc.c
@@ -5290,6 +5290,11 @@ gc_profile_clear(void)
{
rb_objspace_t *objspace = &rb_objspace;
+ /* This method doesn't change profile.run status.
+ * While lazy sweeping, it is possible to touch zero-cleared profile.current_record.
+ */
+ gc_rest_sweep(objspace);
+
if (GC_PROFILE_RECORD_DEFAULT_SIZE * 2 < objspace->profile.size) {
objspace->profile.size = GC_PROFILE_RECORD_DEFAULT_SIZE * 2;
objspace->profile.records = realloc(objspace->profile.records, sizeof(gc_profile_record) * objspace->profile.size);