Skip to content

Commit f732d2b

Browse files
committed
std: xous: pass entire memory range to flag updater
When updating memory flags via `update_memory_flags()`, ensure we multiply the slice length by the element size to get the full memory size. Signed-off-by: Sean Cross <sean@xobs.io>
1 parent 626926f commit f732d2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/os/xous/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ pub(crate) unsafe fn update_memory_flags<T>(
452452
) -> Result<(), Error> {
453453
let mut a0 = Syscall::UpdateMemoryFlags as usize;
454454
let mut a1 = range.as_mut_ptr() as usize;
455-
let a2 = range.len();
455+
let a2 = range.len() * core::mem::size_of::<T>();
456456
let a3 = new_flags.bits();
457457
let a4 = 0; // Process ID is currently None
458458
let a5 = 0;

0 commit comments

Comments
 (0)