Skip to content

Commit 7b76fde

Browse files
committed
Merge branch 'call-probestack' into export-compiler-builtins
2 parents 1e5831f + 6414d13 commit 7b76fde

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/char/rust_example_3.rs

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ impl KernelModule for RustExample3 {
3636
println!("[3] Parameters:");
3737
println!("[3] my_bool: {}", my_bool.read());
3838
println!("[3] my_i32: {}", my_i32.read());
39+
40+
// Including this large variable on the stack will trigger a call to
41+
// `compiler_builtins::probestack::__rust_probestack` on x86_64 (in
42+
// debug mode at least).
43+
// This will verify that we are able to link modules which call
44+
// `__rust_probestack`.
45+
let x: [u64; 1028] = [5; 1028];
46+
println!("Large array has length: {}", x.len());
47+
3948
Ok(RustExample3 {
4049
message: "on the heap!".to_owned(),
4150
})

0 commit comments

Comments
 (0)