Skip to content

Commit fdd45c0

Browse files
authored
Declare escape functions as Ractor-safe (#63)
1 parent dec22c9 commit fdd45c0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ext/erb/escape/escape.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ erb_escape_html(VALUE self, VALUE str)
8989
void
9090
Init_escape(void)
9191
{
92+
#ifdef HAVE_RB_EXT_RACTOR_SAFE
93+
rb_ext_ractor_safe(true);
94+
#endif
95+
9296
rb_cERB = rb_define_class("ERB", rb_cObject);
9397
rb_mEscape = rb_define_module_under(rb_cERB, "Escape");
9498
rb_define_module_function(rb_mEscape, "html_escape", erb_escape_html, 1);

ext/erb/escape/extconf.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
when 'jruby', 'truffleruby'
55
File.write('Makefile', dummy_makefile($srcdir).join)
66
else
7+
have_func("rb_ext_ractor_safe", "ruby.h")
78
create_makefile 'erb/escape'
89
end

0 commit comments

Comments
 (0)