summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/string.c b/string.c
index 8cd93a69b..9a45d2f5c 100644
--- a/string.c
+++ b/string.c
@@ -299,6 +299,14 @@ rb_str_buf_new2(const char *ptr)
return str;
}
+void
+rb_str_free(VALUE str)
+{
+ if (!STR_EMBED_P(str) && !STR_SHARED_P(str)) {
+ xfree(RSTRING(str)->as.heap.ptr);
+ }
+}
+
VALUE
rb_str_to_str(VALUE str)
{