Skip to content

[pull] master from ruby:master#827

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

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

Conversation

@pull
Copy link

@pull pull bot commented Mar 6, 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 : )

jhawthorn and others added 6 commits March 5, 2026 11:03
Previously we initially mapped the full 512MB chunk as
PROT_READ|PROD_WRITE and then set a guard page to PROT_NONE the first
time a new thread stack is needed. Usually that's okay as we don't touch
that memory until it is needed and so it doesn't count towards RSS.

However, on Linux even with vm.overcommit_memory=0 (the default) if on a
system (like a tiny cloud VM) with <512MB of RAM+swap that would error
with.

    Thread#initialize': can't create Thread: Cannot allocate memory (ThreadError)

This changes the chunk to be mapped initially with PROT_NONE, then
instead of mapping the guard pages we map in the machine and VM stacks
using mprotect. This ensures we don't commit stack memory until it is
first used, and as a side benefit any stray pointers into unused stack
should segfault.

When a stack is freed/reused there is no change from the previous
behaviour, we just use madvise and leave the same regions in place.

[Bug #21944]
This PR introduces an almost verbatim implementation of load_store_forward optimization as described in Max's [blog post](https://bernsteinbear.com/blog/toy-load-store/).

After this PR is merged, we will add type based alias analysis.
* This reverts commit ruby/prism@ffe8f7a6e236.
* No longer necessary as the Makefile depends on all *.c and *.h.

ruby/prism@5a33460adc
It gets confused for syntax introduced in https://bugs.ruby-lang.org/issues/20925
But it actually should be a plain method call.
`!`/`?` are not valid as part of an identifier, methods
however allow them as the last character.

Fixes [Bug #21946]

ruby/prism@5d80bc5e1a
@pull pull bot locked and limited conversation to collaborators Mar 6, 2026
@pull pull bot added the ⤵️ pull label Mar 6, 2026
@pull pull bot merged commit 45f030f into turkdevops:master Mar 6, 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.

5 participants