News for hackers. Stuff that matters.
Re:Rust for C++ programmers – part 4: unique pointers by AlisdairO on Tuesday April 29, 2014 @04:04AM (#7665628)
I just tried the following:

        let mut blah = ~MyStruct{x: 3, y: 4};
        for i in range(0,100000000) {
            blah = ~MyStruct{x: i + blah.x, y: i + blah.y};
        }
        println!("{} {}", blah.x, blah.y);
The memory usage didn't increase over time - the owned pointer frees when it gets reassigned.
Re:Rust for C++ programmers – part 4: unique pointers by azth on Tuesday April 29, 2014 @09:40AM (#7666874)
See this example for more details: https://news.ycombinator.com/item?id=7665617