Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
12bitfloat1074226dHow are you measuring the leak? Mem allocators are generally pretty lazy about giving memory back so a reasonable increase in memory over time might be normal behaviour
-
lorentz1531626dGod damn it, I need to write a fucking log aggregator script to figure out where the refcount math is going wrong. I didn't choose Rust for this.
-
lorentz1531626dActually, it'll probably be easier to do it on paper, and this is exactly why I chose Rust. I shudder to think what this would be like if I was also dealing with segfaults emerging from incorrect in-process memory management alongside the panics, errors and leaks emerging from incorrect interprocess resource dependency tracking.
-
i want to leave here for posterity that this solution fully works btw. Many things tripped me up so far, but the only mistake I ever made with Rust's async Future and Stream abstractions was not trusting them enough.
Related Rants
I came up with a really intuitive way to create a coroutine in Rust by passing the sender of an mpsc queue to a callback, then merging the receiver of the same mpsc with the future returned by that callback, but I must've cocked up somewhere because I'm pretty sure it leaks memory.
MPSC ports don't own each other in either direction, that was my first guess too.
rant
rust
coroutines
async