mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
xous: hosted: don't over-allocate memory messages
Call `shrink_to_fit()` on the array that contains memory messages. This is beacuse we throw away the `capacity` field, and we want to make sure we can reconstitute the vector at a later stage. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
180c99aa8d
commit
486d993c4c
1 changed files with 2 additions and 0 deletions
|
|
@ -687,6 +687,8 @@ fn _xous_syscall_result(ret: &mut Result, thread_id: TID, server_connection: &Se
|
|||
eprintln!("Server shut down: {}", e);
|
||||
std::process::exit(0);
|
||||
}
|
||||
data.shrink_to_fit();
|
||||
assert_eq!(data.len(), data.capacity());
|
||||
let len = data.len();
|
||||
let addr = data.as_mut_ptr();
|
||||
memory_message.buf.addr = crate::MemoryAddress::new(addr as _).unwrap();
|
||||
|
|
|
|||
Loading…
Reference in a new issue