Created
March 14, 2012 21:50
-
-
Save nikomatsakis/2039794 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn foo() -> @memory_pool { | |
// let the region for this block be "r_foo" | |
let p: @memory_pool = pool(); | |
let x: &r_foo.T = new(p) T; | |
ret p; // x cannot be returned because r_foo is not in scope | |
} | |
fn bar() { | |
let p = foo(); // memory for p is not yet freed... | |
// ...but I can't access the prior contents. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment