MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / on_small_stack

Function on_small_stack

codegraph-kernel/src/stack.rs:192–199  ·  view source on GitHub ↗
(f: impl FnOnce() -> T + Send + 'static)

Source from the content-addressed store, hash-verified

190 const DEPTH: usize = 30_000;
191
192 fn on_small_stack<T: Send + 'static>(f: impl FnOnce() -> T + Send + 'static) -> T {
193 std::thread::Builder::new()
194 .stack_size(SMALL_STACK)
195 .spawn(f)
196 .expect("spawn")
197 .join()
198 .expect("walker thread panicked")
199 }
200
201 fn nested_parens(prefix: &str, suffix: &str) -> String {
202 format!("{prefix}{}1{}{suffix}", "(".repeat(DEPTH), ")".repeat(DEPTH))

Calls 1

joinMethod · 0.45