mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
examples: remove memory checks
These take a long time to start up. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
1b8f97a5a3
commit
2abf3c8600
2 changed files with 52 additions and 52 deletions
|
|
@ -42,33 +42,33 @@ fn main() {
|
|||
xous::syscall::claim_interrupt(4, handle_irq, 0 as *mut usize)
|
||||
.expect("couldn't claim interrupt");
|
||||
|
||||
println!("Allocating a ton of space on the stack...");
|
||||
{
|
||||
let _big_array = [42u8; 131072];
|
||||
}
|
||||
// println!("Allocating a ton of space on the stack...");
|
||||
// {
|
||||
// let _big_array = [42u8; 131072];
|
||||
// }
|
||||
|
||||
println!("Increasing heap to 131072...");
|
||||
let heap = xous::rsyscall(xous::SysCall::IncreaseHeap(
|
||||
131072,
|
||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||
))
|
||||
.expect("couldn't increase heap");
|
||||
if let xous::Result::MemoryRange(range) = heap {
|
||||
println!(
|
||||
"Heap goes from {:08x} - {:08x}",
|
||||
range.base as usize,
|
||||
range.base as usize + range.size
|
||||
);
|
||||
use core::slice;
|
||||
let mem_range = unsafe { slice::from_raw_parts_mut(range.base, range.size) };
|
||||
println!("Filling with bytes...");
|
||||
for word in mem_range.iter_mut() {
|
||||
*word = 42;
|
||||
}
|
||||
println!("Done!");
|
||||
} else {
|
||||
println!("Unexpected return value: {:?}", heap);
|
||||
}
|
||||
// println!("Increasing heap to 131072...");
|
||||
// let heap = xous::rsyscall(xous::SysCall::IncreaseHeap(
|
||||
// 131072,
|
||||
// xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||
// ))
|
||||
// .expect("couldn't increase heap");
|
||||
// if let xous::Result::MemoryRange(range) = heap {
|
||||
// println!(
|
||||
// "Heap goes from {:08x} - {:08x}",
|
||||
// range.base as usize,
|
||||
// range.base as usize + range.size
|
||||
// );
|
||||
// use core::slice;
|
||||
// let mem_range = unsafe { slice::from_raw_parts_mut(range.base, range.size) };
|
||||
// println!("Filling with bytes...");
|
||||
// for word in mem_range.iter_mut() {
|
||||
// *word = 42;
|
||||
// }
|
||||
// println!("Done!");
|
||||
// } else {
|
||||
// println!("Unexpected return value: {:?}", heap);
|
||||
// }
|
||||
|
||||
let server_addr = xous::syscall::create_server(xous::make_name!("📜")).expect("couldn't create server");
|
||||
|
||||
|
|
|
|||
|
|
@ -56,33 +56,33 @@ fn main() {
|
|||
))
|
||||
.expect("couldn't claim interrupt");
|
||||
|
||||
println!("Allocating a ton of space on the stack...");
|
||||
{
|
||||
let _big_array = [42u8; 131072];
|
||||
}
|
||||
// println!("Allocating a ton of space on the stack...");
|
||||
// {
|
||||
// let _big_array = [42u8; 131072];
|
||||
// }
|
||||
|
||||
println!("Increasing heap to 131072...");
|
||||
let heap = xous::rsyscall(xous::SysCall::IncreaseHeap(
|
||||
131072,
|
||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||
))
|
||||
.expect("couldn't increase heap");
|
||||
if let xous::Result::MemoryRange(range) = heap {
|
||||
println!(
|
||||
"Heap goes from {:08x} - {:08x}",
|
||||
range.base as usize,
|
||||
range.base as usize + range.size
|
||||
);
|
||||
use core::slice;
|
||||
let mem_range = unsafe { slice::from_raw_parts_mut(range.base, range.size) };
|
||||
println!("Filling with bytes...");
|
||||
for word in mem_range.iter_mut() {
|
||||
*word = 42;
|
||||
}
|
||||
println!("Done!");
|
||||
} else {
|
||||
println!("Unexpected return value: {:?}", heap);
|
||||
}
|
||||
// println!("Increasing heap to 131072...");
|
||||
// let heap = xous::rsyscall(xous::SysCall::IncreaseHeap(
|
||||
// 131072,
|
||||
// xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||
// ))
|
||||
// .expect("couldn't increase heap");
|
||||
// if let xous::Result::MemoryRange(range) = heap {
|
||||
// println!(
|
||||
// "Heap goes from {:08x} - {:08x}",
|
||||
// range.base as usize,
|
||||
// range.base as usize + range.size
|
||||
// );
|
||||
// use core::slice;
|
||||
// let mem_range = unsafe { slice::from_raw_parts_mut(range.base, range.size) };
|
||||
// println!("Filling with bytes...");
|
||||
// for word in mem_range.iter_mut() {
|
||||
// *word = 42;
|
||||
// }
|
||||
// println!("Done!");
|
||||
// } else {
|
||||
// println!("Unexpected return value: {:?}", heap);
|
||||
// }
|
||||
|
||||
timer::init();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue