Skip to content

[pull] master from ruby:master#777

Merged
pull[bot] merged 6 commits intoturkdevops:masterfrom
ruby:master
Feb 13, 2026
Merged

[pull] master from ruby:master#777
pull[bot] merged 6 commits intoturkdevops:masterfrom
ruby:master

Conversation

@pull
Copy link

@pull pull bot commented Feb 13, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

eightbitraptor and others added 6 commits February 13, 2026 14:29
Replace the BASE_SLOT_SIZE-granularity bitmap scheme with slot-based
indexing where each bit represents one slot regardless of size.

Key changes:
- Add slot_div_magic field to heap_page for fast division
- Use Go-inspired formula: slot_index = (offset * div_magic) >> 32
- Update all bitmap iteration to use one-bit-per-slot scheme
- Remove slot_bits_mask from rb_heap_t (no longer needed)

This enables arbitrary slot sizes (not just power-of-two multiples of
BASE_SLOT_SIZE) by decoupling bitmap indexing from slot size.

Functions updated:
- gc_sweep_plane/gc_sweep_page
- rgengc_rememberset_mark/rgengc_rememberset_mark_plane
- gc_marks_wb_unprotected_objects/gc_marks_wb_unprotected_objects_plane
- gc_compact_plane/gc_compact_page
- invalidate_moved_plane/invalidate_moved_page
- RVALUE_AGE_GET/RVALUE_AGE_SET_BITMAP

Inspired by Go runtime's mbitmap.go divideByElemSize().
instead of computing them on page add
because BASE_SLOT_SIZE changes on 32 bit, and when debug/devel symbols
are added
As @jhawthorn pointed out, the original calculation used `(1 << 32) /
heap->slot_size + 1)` which leads to a subtle off by one error that gets
shifted away because our slot sizes aren't powers of 2.

This is still worth fixing now, so that we don't trip up over it if we
change slot sizes in the future.
When we hit EOF and still have lex modes left, it means some content was unterminated.
Heredocs specifically have logic that needs to happen when the body finished lexing.
If we don't reset the mode back to how it was before, it will not continue lexing at the correct place.

Followup to ruby/prism#3918.
We can't call into `parser_lex` since it resets token locations.

ruby/prism@27c24fdc0d
@pull pull bot locked and limited conversation to collaborators Feb 13, 2026
@pull pull bot added the ⤵️ pull label Feb 13, 2026
@pull pull bot merged commit bf1ac3f into turkdevops:master Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants