diff options
author | Jeremy Evans <[email protected]> | 2021-09-23 12:31:32 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2021-10-02 05:51:29 -0900 |
commit | 3f7da458a77f270d96e6a9f82177d6c90476c34d (patch) | |
tree | 24a13661f2ac94f9c4bf2437c1e7c241c3275b9e /transcode.c | |
parent | e0ef4899f3ef2561ae32275c2c3d11914e7343c7 (diff) |
Make encoding loading not issue warning
Instead of relying on setting an unsetting ruby_verbose, which is
not thread-safe, restructure require_internal and load_lock to
accept a warn argument for whether to warn, and add
rb_require_internal_silent to require without warnings. Use
rb_require_internal_silent when loading encoding.
Note this does not modify ruby_debug and errinfo handling, those
remain thread-unsafe.
Also silent requires when loading transcoders.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4887
Diffstat (limited to 'transcode.c')
-rw-r--r-- | transcode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/transcode.c b/transcode.c index bc985992a1..ec0507ca80 100644 --- a/transcode.c +++ b/transcode.c @@ -376,6 +376,8 @@ transcode_search_path(const char *sname, const char *dname, return pathlen; /* is -1 if not found */ } +int rb_require_internal_silent(VALUE fname); + static const rb_transcoder * load_transcoder_entry(transcoder_entry_t *entry) { @@ -393,7 +395,7 @@ load_transcoder_entry(transcoder_entry_t *entry) memcpy(path + sizeof(transcoder_lib_prefix) - 1, lib, len); rb_str_set_len(fn, total_len); OBJ_FREEZE(fn); - rb_require_string(fn); + rb_require_internal_silent(fn); } if (entry->transcoder) |