Skip to content

--stdin FILE; lay out on a thread with a 256 MB stack - #7

Merged
JKRT merged 1 commit into
masterfrom
stdin-large-stack
Nov 12, 2026
Merged

JKRT merged 1 commit into
masterfrom
stdin-large-stack

Conversation

@JKRT

@JKRT JKRT commented Nov 12, 2026

Copy link
Copy Markdown
Member

--stdin FILE reads the text of FILE from the standard input. OMEdit can then run mocoal as a child process on unsaved text, and the library lookup next to FILE still works. Output is byte-identical to file mode.

Deep nesting overflowed the 8 MB main thread and aborted the process at 3000 nested parentheses; omc loads up to 10000. The program and mocoal_layout now lay out on a thread with a 256 MB stack, or on the current thread if no such thread can be made. Depths 3000, 7000 and 10000 work; 100000 still overflows.

  • 61 tests pass; fmt and clippy clean.
  • New tests: 4000 nested parentheses, the current-thread fallback (test hook), a panic returned as an error, --stdin parsing.
  • The OMEdit File > Format > Auto Layout change needs this, so it needs a release after 0.1.0.

--stdin FILE reads the text of FILE from the standard input, so a
caller (OMEdit) can run mocoal as a child process on unsaved text and
keep the library lookup next to FILE.

Deep nesting overflowed the stack and aborted the process: 3000 nested
parentheses on the 8 MB main thread (omc loads up to 10000). The
program and mocoal_layout now lay out on a thread with a 256 MB stack,
or on the current thread when the system gives no such thread.

Assisted-by: Claude Opus 5.5
@JKRT
JKRT merged commit a087d57 into master Nov 12, 2026
2 checks passed
@JKRT
JKRT deleted the stdin-large-stack branch November 12, 2026 12:32
This was referenced Nov 12, 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