aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gc.c b/gc.c
index af44914c39..f344bb88b1 100644
--- a/gc.c
+++ b/gc.c
@@ -8938,6 +8938,15 @@ rb_gc_enable(void)
return old ? Qtrue : Qfalse;
}
+VALUE
+rb_gc_disable_no_rest(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ int old = dont_gc;
+ dont_gc = TRUE;
+ return old ? Qtrue : Qfalse;
+}
+
/*
* call-seq:
* GC.disable -> true or false
@@ -8954,12 +8963,8 @@ VALUE
rb_gc_disable(void)
{
rb_objspace_t *objspace = &rb_objspace;
- int old = dont_gc;
-
gc_rest(objspace);
-
- dont_gc = TRUE;
- return old ? Qtrue : Qfalse;
+ return rb_gc_disable_no_rest();
}
static int