diff options
author | Jean Boussier <byroot@ruby-lang.org> | 2023-04-13 12:11:14 +0200 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2023-04-13 16:36:17 +0200 |
commit | ac123f167a364c3d7a43eca78d564e41f6dbb91e (patch) | |
tree | 76c34bd65a5942ce9ef38e1753943e83082f08ee /ruby.c | |
parent | 854baee2c936006d7f38ebb27ee577c00afc6249 (diff) | |
download | ruby-ac123f167a364c3d7a43eca78d564e41f6dbb91e.tar.gz |
Emit a performance warning when a class reached max variations
[Feature #19538]
This new `peformance` warning category is disabled by default.
It needs to be specifically enabled via `-W:performance` or `Warning[:performance] = true`
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -331,6 +331,7 @@ usage(const char *name, int help, int highlight, int columns) static const struct ruby_opt_message warn_categories[] = { M("deprecated", "", "deprecated features"), M("experimental", "", "experimental features"), + M("performance", "", "performance issues"), }; #if USE_YJIT static const struct ruby_opt_message yjit_options[] = { @@ -1190,6 +1191,9 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt) else if (NAME_MATCH_P("experimental", s, len)) { bits = 1U << RB_WARN_CATEGORY_EXPERIMENTAL; } + else if (NAME_MATCH_P("performance", s, len)) { + bits = 1U << RB_WARN_CATEGORY_PERFORMANCE; + } else { rb_warn("unknown warning category: `%s'", s); } |