From cf1fc44f7e6adf7921ba3caaa7a6f91a3f3ce09d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 26 Mar 2021 12:14:16 +0800 Subject: [PATCH] xous: return buffer offset as part of MemoryMessages When a MemoryMessage goes out of scope, update the buffer offset and valid fields. This allows the caller to see what's changed. Signed-off-by: Sean Cross --- xous-rs/src/definitions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xous-rs/src/definitions.rs b/xous-rs/src/definitions.rs index c550fc6b4..5e3378f4b 100644 --- a/xous-rs/src/definitions.rs +++ b/xous-rs/src/definitions.rs @@ -500,7 +500,7 @@ impl Drop for MessageEnvelope { fn drop(&mut self) { match &self.body { Message::Borrow(x) | Message::MutableBorrow(x) => { - crate::syscall::return_memory(self.sender, x.buf).expect("couldn't return memory") + crate::syscall::return_memory_offset(self.sender, x.buf, x.offset).expect("couldn't return memory") } Message::Move(msg) => { crate::syscall::unmap_memory(msg.buf).expect("couldn't free memory message")