diff --git a/mission_rust/src/fsrc/datasets/mod.rs b/mission_rust/src/fsrc/datasets/mod.rs index eeb5065..911d2a3 100644 --- a/mission_rust/src/fsrc/datasets/mod.rs +++ b/mission_rust/src/fsrc/datasets/mod.rs @@ -88,8 +88,6 @@ impl OwnedDataset { }; self.actual_data = data; } - - fn initialize(&mut self) {} } impl ReferencedDataset { diff --git a/mission_rust/src/fsrc/mod.rs b/mission_rust/src/fsrc/mod.rs index f56e588..a892f6b 100644 --- a/mission_rust/src/fsrc/mod.rs +++ b/mission_rust/src/fsrc/mod.rs @@ -6,4 +6,5 @@ pub mod osal; pub mod tasks; pub mod objectmanager; pub mod datasets; +pub mod store; mod mutex; \ No newline at end of file diff --git a/mission_rust/src/fsrc/queues/mod.rs b/mission_rust/src/fsrc/queues/mod.rs index f752174..b7be59d 100644 --- a/mission_rust/src/fsrc/queues/mod.rs +++ b/mission_rust/src/fsrc/queues/mod.rs @@ -1,5 +1,8 @@ use crate::{check_global_threading_available, osal}; + +// TODO test dropping of droppable data within messages (no drop on sending, dropping when receiving, no dropping when forwarding in new message) + pub struct MessageQueue { queue_data: [Message; DEPTH], queue_id: Option<*const core::ffi::c_void>, @@ -73,12 +76,16 @@ impl MessageQueueSender { Self { queue_id: None } } + // TODO if error, message is dropped, is this intended or should we return the message back out? pub fn send(&self, message: Message) -> Result<(), ()> { check_global_threading_available!(); let queue_id = match self.queue_id { None => return Err(()), Some(id) => id, }; + // we move ownership out to C (so must not drop it) + // regaining ownership in receive() where it then will be dropped + let message = core::mem::ManuallyDrop::new(message); let res: u8; unsafe { // safe because: