diff options
| author | Koichi Sasada <ko1@atdot.net> | 2020-10-13 13:16:08 +0900 |
|---|---|---|
| committer | Koichi Sasada <ko1@atdot.net> | 2020-10-14 14:02:06 +0900 |
| commit | 11c2f0f36ccc50899a8dd69a260e85451f68b5ba (patch) | |
| tree | 4d968f2742fb0cb4d260c1f2c6b2695184e21d9e /spec/ruby/core/array/replace_spec.rb | |
| parent | c3ba3fa8d01aa3970dc1f4e3dc0090ae171e9e35 (diff) | |
sync enc_table and rb_encoding_list
enc_table which manages Encoding information. rb_encoding_list
also manages Encoding objects. Both are accessed/modified by ractors
simultaneously so that they should be synchronized.
For enc_table, this patch introduced GLOBAL_ENC_TABLE_ENTER/LEAVE/EVAL
to access this table with VM lock. To make shortcut, three new global
variables global_enc_ascii, global_enc_utf_8, global_enc_us_ascii are
also introduced.
For rb_encoding_list, we split it to rb_default_encoding_list (256 entries)
and rb_additional_encoding_list. rb_default_encoding_list is fixed sized Array
so we don't need to synchronized (and most of apps only needs it). To manage
257 or more encoding objects, they are stored into rb_additional_encoding_list.
To access rb_additional_encoding_list., VM lock is needed.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3654
Diffstat (limited to 'spec/ruby/core/array/replace_spec.rb')
0 files changed, 0 insertions, 0 deletions
