summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gc.c15
-rw-r--r--gc.h2
-rw-r--r--transient_heap.c2
3 files changed, 13 insertions, 6 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
diff --git a/gc.h b/gc.h
index 727890181a..f3b433f0c4 100644
--- a/gc.h
+++ b/gc.h
@@ -94,6 +94,8 @@ const char *rb_obj_info(VALUE obj);
const char *rb_raw_obj_info(char *buff, const int buff_size, VALUE obj);
void rb_obj_info_dump(VALUE obj);
+VALUE rb_gc_disable_no_rest(void);
+
struct rb_thread_struct;
RUBY_SYMBOL_EXPORT_BEGIN
diff --git a/transient_heap.c b/transient_heap.c
index bf2de155df..81cd495c6d 100644
--- a/transient_heap.c
+++ b/transient_heap.c
@@ -730,7 +730,7 @@ transient_heap_evacuate(void *dmy)
if (TRANSIENT_HEAP_DEBUG >= 1) fprintf(stderr, "!! transient_heap_evacuate: skip while transient_heap_marking\n");
}
else {
- VALUE gc_disabled = rb_gc_disable();
+ VALUE gc_disabled = rb_gc_disable_no_rest();
struct transient_heap_block* block;
if (TRANSIENT_HEAP_DEBUG >= 1) {