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

Function small_stack_reports_its_own_bounds

codegraph-kernel/src/stack.rs:216–228  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214
215 #[test]
216 fn small_stack_reports_its_own_bounds() {
217 on_small_stack(|| {
218 let low = os_stack_low().expect("OS stack bounds available");
219 let used = current_sp() - low;
220 // std/the OS round the requested size up a little (macOS reports
221 // 1,060,864 for a 1 MiB request); the point is that the bounds
222 // describe THIS thread's small stack, not the main thread's.
223 assert!(
224 used <= SMALL_STACK + 128 * 1024,
225 "used {used} is not within the {SMALL_STACK}-byte stack"
226 );
227 });
228 }
229
230 #[test]
231 fn deep_braces_c_defer_instead_of_crashing() {

Callers

nothing calls this directly

Calls 3

on_small_stackFunction · 0.85
os_stack_lowFunction · 0.85
current_spFunction · 0.85

Tested by

no test coverage detected