Skip to content

Add native stack size control and pool invalidation on resize#35

Closed
bragaigor wants to merge 5 commits intostylusfrom
nm004-config-stylus-stack-size
Closed

Add native stack size control and pool invalidation on resize#35
bragaigor wants to merge 5 commits intostylusfrom
nm004-config-stylus-stack-size

Conversation

@bragaigor
Copy link
Copy Markdown
Contributor

@bragaigor bragaigor commented Mar 20, 2026

  • Add a thread-local stack size override (set_thread_stack_size / get_thread_stack_size) so individual threads (e.g. the Stylus retry loop) can request a larger coroutine stack without affecting other threads
  • Make the stack pool size-aware: pooled stacks are tagged with their allocation size and undersized entries are skipped during reuse, preventing a thread requesting a large stack from getting a small one
  • Extract MAX_STACK_SIZE constant and get_stack_size() getter as public API
  • Propagate stack allocation failures as Trap::OOM instead of panicking

pulled by OffchainLabs/nitro#4538
part of NIT-4686

Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
@bragaigor
Copy link
Copy Markdown
Contributor Author

closing in pro of #37

@bragaigor bragaigor closed this Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant