-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-codegenArea: Code generationArea: Code generationE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.
Description
Example 2014-02-23
struct Foo { data: int, next: Option<~Foo> }
fn main() {
let mut foo = Some(~Foo { data: 0, next: None });
for i in range(0, 17_000_000) {
if i % 1000000 == 0 {
error!("{}", i);
}
foo = Some(~Foo { data: i, next: foo.take() });
}
}Original example
use std::cell::Cell;
struct Foo { data: int, next: Option<~Foo> }
fn main() {
let foo = Cell::new(Foo { data: 0, next: None });
let mut i = 0;
do 17_000_000.times {
i += 1;
if i % 1000000 == 0 {
error!("%d", i);
}
foo.put_back(Foo { data: i, next: Some(~foo.take()) });
}
}Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.