diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2023-08-30 15:28:22 -0400 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2023-08-31 09:28:31 -0400 |
| commit | 4f0d58260a7f506ead198064d12a967edd11fe5e (patch) | |
| tree | 060ea8fef61b6b4240ee74dbe3cff410fe44e6b8 /test/ruby/test_thread_queue.rb | |
| parent | eb3d94f4baff70d2e120c9472a3851a4aa9c90d9 (diff) | |
Correctly calculate initial pages
The old algorithm could calculate an undercount for the initial pages
due to two issues:
1. It did not take into account that some heap pages will have one less
slot due to alignment. It assumed that every heap page would be able
to be fully filled with slots. Pages that are unaligned with the slot
size will lose one slot. The new algorithm assumes that every page
will be unaligned.
2. It performed integer division, which truncates down. This means that
the number of pages might not actually satisfy the number of slots.
This can cause the heap to grow in `gc_sweep_finish_size_pool` after
allocating all of the allocatable pages because the total number of
slots would be less than the initial configured number of slots.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8333
Diffstat (limited to 'test/ruby/test_thread_queue.rb')
0 files changed, 0 insertions, 0 deletions
