diff options
| author | John Hawthorn <john@hawthorn.email> | 2025-07-07 16:44:42 -0700 |
|---|---|---|
| committer | John Hawthorn <john@hawthorn.email> | 2025-07-09 10:38:04 -0700 |
| commit | 54f28c1db9bfd1d8f90f665a1fa9d2b8a1fc8d00 (patch) | |
| tree | 19cb8e1e318b168bca65efc4c897d1887788e017 /include/ruby/backward | |
| parent | cfc006d410014f03e59179994b4607c468c378c7 (diff) | |
Avoid concurrently overflowing of shape_id
Previously it was possible for two atomic increments of next_shape_id
running concurrently to overflow MAX_SHAPE_ID. For this reason we need
to do the test atomically with the allocation in shape_alloc returning
NULL.
This avoids overflowing next_shape_id by repeatedly attempting a CAS.
Alternatively we could have allowed incrementing past MAX_SHAPE_ID and
then clamping in rb_shapes_count, but this seems simpler.
Diffstat (limited to 'include/ruby/backward')
0 files changed, 0 insertions, 0 deletions
