aboutsummaryrefslogtreecommitdiffstats
path: root/ext/-test-/symbol/type.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/-test-/symbol/type.c')
-rw-r--r--ext/-test-/symbol/type.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/-test-/symbol/type.c b/ext/-test-/symbol/type.c
index c6dbdd1f8e..296c74c105 100644
--- a/ext/-test-/symbol/type.c
+++ b/ext/-test-/symbol/type.c
@@ -53,6 +53,17 @@ bug_dynamic_p(VALUE self, VALUE sym)
return DYNAMIC_SYM_P(sym) ? Qtrue : Qfalse;
}
+#ifdef HAVE_RB_PIN_DYNAMIC_SYMBOL
+ID rb_pin_dynamic_symbol(VALUE);
+
+static VALUE
+bug_pindown(VALUE self, VALUE sym)
+{
+ rb_pin_dynamic_symbol(sym);
+ return sym;
+}
+#endif
+
void
Init_type(VALUE klass)
{
@@ -61,4 +72,7 @@ Init_type(VALUE klass)
rb_define_singleton_method(klass, "id2str", bug_id2str, 1);
rb_define_singleton_method(klass, "static?", bug_static_p, 1);
rb_define_singleton_method(klass, "dynamic?", bug_dynamic_p, 1);
+#ifdef HAVE_RB_PIN_DYNAMIC_SYMBOL
+ rb_define_singleton_method(klass, "pindown", bug_pindown, 1);
+#endif
}