image display now works, once heap increase is called

takes about 1MiB of heap to decode the test PNG.

Putting the heap increase at boot seems to not
work, it causes other processes to not spawn. The condition
is not terribly reproducible, so it's probably a concurrency
issue of some type.
This commit is contained in:
bunnie 2022-06-27 04:03:49 +08:00
parent fd63a33078
commit 79cb4cd982
2 changed files with 21 additions and 2 deletions

View file

@ -289,6 +289,25 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
}
#[cfg(feature="ditherpunk")]
"image" => {
let new_limit = 2048 * 1024;
let result = xous::rsyscall(xous::SysCall::AdjustProcessLimit(
xous::Limits::HeapMaximum as usize,
0,
new_limit,
));
if let Ok(xous::Result::Scalar2(1, current_limit)) = result {
xous::rsyscall(xous::SysCall::AdjustProcessLimit(
xous::Limits::HeapMaximum as usize,
current_limit,
new_limit,
))
.unwrap();
log::info!("Our new heap is: {}", new_limit);
} else {
panic!("Unsupported syscall!");
}
#[cfg(feature="tracking-alloc")]
use tracking_allocator::{
AllocationGroupToken, AllocationRegistry,
@ -360,7 +379,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
} else {
if len < last_chunk {
log::info!("heuristic termination of read loop");
// break;
break;
}
}
},

View file

@ -362,7 +362,7 @@ fn main () -> ! {
wrapped_main();
#[cfg(feature="ditherpunk")]
let stack_size = 1024 * 1024;
let stack_size = 2048 * 1024;
#[cfg(feature="ditherpunk")]
std::thread::Builder::new()
.stack_size(stack_size)