Program crash: GC destroys an object unexpectedly
eugene
dee0xeed at gmail.com
Tue Sep 14 13:31:48 UTC 2021
On Tuesday, 14 September 2021 at 12:53:27 UTC, Adam D Ruppe wrote:
> I had a problem just like this before because I was sending
> objects through the pipe. And while they were in the pipe -
```rust
pub fn msg(&self, code: u32) {
let ptr: *const u32 = &code;
let n = unsafe { write(self.mxfd, ptr as *const void, 4)
};
if -1 == n {
panic!("write({}): {:?}", self.mxfd,
Error::last_os_error());
}
}
```
I failed to implement message queue as a wrapper over double list,
rust borrow checker has beaten me :)
More information about the Digitalmars-d-learn
mailing list