Skip to content

Use stacker to prevent stack overflow from depth-first query evaluation. #41884

Closed

Description

stacker is:

A library to help grow the stack when it runs out of space.

This is an implementation of manually instrumented segmented stacks where points in a program's control flow are annotated with "maybe grow the stack here". Each point of annotation indicates how far away from the end of the stack it's allowed to be, plus the amount of stack to allocate if it does reach the end.

Once a program has reached the end of its stack, a temporary stack on the heap is allocated and is switched to for the duration of a closure.

Recent PRs that might be relevant: #41625 (MIR inlining) and #41676 (macro expansion).

Also related: #40161, a meta issue for places where deep recursion arise.

cc @rust-lang/compiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions