summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi/ext/gc_spec.c
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/optional/capi/ext/gc_spec.c')
-rw-r--r--spec/ruby/optional/capi/ext/gc_spec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/ext/gc_spec.c b/spec/ruby/optional/capi/ext/gc_spec.c
index 0a76b9d40a..57b1f11faa 100644
--- a/spec/ruby/optional/capi/ext/gc_spec.c
+++ b/spec/ruby/optional/capi/ext/gc_spec.c
@@ -29,6 +29,10 @@ static VALUE gc_spec_rb_gc() {
return Qnil;
}
+static VALUE gc_spec_rb_gc_adjust_memory_usage(VALUE self, VALUE diff) {
+ rb_gc_adjust_memory_usage(NUM2SSIZET(diff));
+ return Qnil;
+}
void Init_gc_spec(void) {
VALUE cls = rb_define_class("CApiGCSpecs", rb_cObject);
@@ -43,6 +47,7 @@ void Init_gc_spec(void) {
rb_define_method(cls, "rb_gc_enable", gc_spec_rb_gc_enable, 0);
rb_define_method(cls, "rb_gc_disable", gc_spec_rb_gc_disable, 0);
rb_define_method(cls, "rb_gc", gc_spec_rb_gc, 0);
+ rb_define_method(cls, "rb_gc_adjust_memory_usage", gc_spec_rb_gc_adjust_memory_usage, 1);
}
#ifdef __cplusplus