MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / user_heap_grows_past_64k

Function user_heap_grows_past_64k

tests/integration/kernel_integration.rs:456–479  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

454 v: u8 = (i + 1) as u8
455 @far = v
456 if (@far) != v {
457 return 2
458 }
459 i = i + 1
460 }
461 return 0
462}
463"#,
464 "user_heap_grows_past_64k",
465 );
466}
467
468// A grow above USER_ARG_BASE (0x7FF00000) would eat the arg page and stack, so
469// brk returns the unchanged break and a later in-bounds grow still succeeds.
470#[test]
471fn user_brk_refuses_growth_into_arg_page() {
472 run_example_in_kernel(
473 r#"external heap_brk: (addr: u64) -> u64
474main: () -> i32 {
475 base: u64 = heap_brk(0)
476 big: u64 = 0x7FFFF000
477 got: u64 = heap_brk(big)
478 if got >= big {
479 return 1
480 }
481 if got != base {
482 return 2

Callers

nothing calls this directly

Calls 1

run_example_in_kernelFunction · 0.85

Tested by

no test coverage detected