mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Stop exposing rb_str_chilled_p
[Feature #20205] Now that chilled strings no longer appear as frozen, there is no need to offer an API to check for chilled strings. We however need to change `rb_check_frozen_internal` to no longer be a macro, as it needs to check for chilled strings.
This commit is contained in:
parent
3eba84fba0
commit
730e3b2ce0
9 changed files with 14 additions and 84 deletions
10
error.c
10
error.c
|
@ -3914,14 +3914,20 @@ rb_error_frozen_object(VALUE frozen_obj)
|
|||
void
|
||||
rb_check_frozen(VALUE obj)
|
||||
{
|
||||
rb_check_frozen_internal(obj);
|
||||
if (RB_UNLIKELY(RB_OBJ_FROZEN(obj))) {
|
||||
rb_error_frozen_object(obj);
|
||||
}
|
||||
|
||||
if (RB_UNLIKELY(CHILLED_STRING_P(obj))) {
|
||||
rb_str_modify(obj);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rb_check_copyable(VALUE obj, VALUE orig)
|
||||
{
|
||||
if (!FL_ABLE(obj)) return;
|
||||
rb_check_frozen_internal(obj);
|
||||
rb_check_frozen(obj);
|
||||
if (!FL_ABLE(orig)) return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue