News for hackers. Stuff that matters.
Re:Dealing with Out-of-Memory Conditions in Rust by umanwizard on Sunday August 15, 2021 @12:07AM (#28186190)

    fn maybe_alloc() -> Vec<usize> {
        if collatz_conjecture_is_true() {
            vec![42]
        } else {
            vec![]
        }
    }

    fn main() {
        let v = maybe_alloc(); // Does this allocate?
    }
Re:Dealing with Out-of-Memory Conditions in Rust by wtetzner on Sunday August 15, 2021 @09:35AM (#28188662)
You would just assume it does. Really you want to detect all places that might allocate.
Re:Dealing with Out-of-Memory Conditions in Rust by umanwizard on Sunday August 15, 2021 @10:49AM (#28189196)
You are right. It’s definitely possible if you accept false positives.