Created
August 25, 2012 18:59
-
-
Save stepancheg/3469333 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
import printer.*; | |
import unix; | |
record LargeRecord ( | |
a: Array[RawPointer, 1024], | |
); | |
foo() { | |
var a = LargeRecord(); | |
// call any function that is guaranteed to be not inlined | |
unix.write(-1, RawPointer(@a), 1); | |
} | |
bar(n) { | |
if (n > 0) { | |
foo(); | |
bar(n - 1); | |
} | |
} | |
// crashes when compiled with -O2 | |
// works fine with -O0 | |
main() { | |
..for (n in 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000) { | |
println(n); | |
bar(n); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment