MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / sample_process_fits_in_a_small_stack

Function sample_process_fits_in_a_small_stack

src/runtime_telemetry.rs:382–393  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

380 /// inside a stack far smaller than Windows' 1 MiB main-thread default.
381 #[test]
382 fn sample_process_fits_in_a_small_stack() {
383 // Zero CPU sample window: the stack-footprint guard cares about the
384 // sysinfo refresh path, not the CPU delta, so skip the 200 ms sleep.
385 let handle = std::thread::Builder::new()
386 .stack_size(512 * 1024)
387 .spawn(|| sample_process_with_window(Duration::ZERO))
388 .expect("spawn small-stack thread");
389 let snap = handle
390 .join()
391 .expect("sample_process must not overflow a 512 KiB stack");
392 assert_eq!(snap.pid, std::process::id());
393 }
394}

Callers

nothing calls this directly

Calls 2

spawnMethod · 0.45

Tested by

no test coverage detected