summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorÉtienne Barrié <[email protected]>2024-03-25 11:18:26 +0100
committerJean Boussier <[email protected]>2024-03-26 12:54:54 +0100
commit2b08406cd0db0042520fb0346544660e10a4d93c (patch)
tree9b649ec091c72b13227687d6e19079f67c14da5b /string.c
parent8cfa8e87b2705fb356bbbb9ef719b5c5a54f9862 (diff)
Expose rb_str_chilled_p
Some extensions (like stringio) may need to differentiate between chilled strings and frozen strings. They can now use rb_str_chilled_p but must check for its presence since the function will be removed when chilled strings are removed. [Bug #20389] [Feature #20205] Co-authored-by: Jean Boussier <[email protected]>
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/string.c b/string.c
index 9d84b16a07..5c29718dff 100644
--- a/string.c
+++ b/string.c
@@ -1833,6 +1833,12 @@ rb_ec_str_resurrect(struct rb_execution_context_struct *ec, VALUE str, bool chil
return new_str;
}
+bool
+rb_str_chilled_p(VALUE str)
+{
+ return CHILLED_STRING_P(str);
+}
+
/*
*
* call-seq: