Hello,
To be clear: there is no such thing as stack/heap in C and C++, there are
automatic variable and dynamically allocated variables, the former having
their lifetime known statically and the latter not...
Whether a particular compiler chooses to use the stack or heap for either
is its free
Shouldn't the compiler automatically put large arrays on the heap? I thought
this was a common
thing to do beyond a certain memory size.
On Thursday 27 November 2014 04:28:03 Steven Fackler wrote:
The `nums` array is allocated on the stack and is 8 MB (assuming you're on a 64
bit platform).
Rust is not interested in putting anything automatically on the heap. :)
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev
C++/C has a lot of features which seem tantalizing at first; but end up
being against the point of a systems language.
Putting large arrays on the heap (not sure if C++ does this, but it sounds
like something C++ would do) is one -- there are plenty of cases where you
explicitly want stack-based
Hey folks, I've started writing some rust code lately and run into weird
behavior when benchmarking. When running
https://gist.github.com/benwilson512/56f84d4625f11feb
#[bench]
fn test_overflow(b: mut Bencher) {
let nums = [0i, ..100];
b.iter(|| {
let mut x = 0i;
for i in
The `nums` array is allocated on the stack and is 8 MB (assuming you're on
a 64 bit platform).
On Wed Nov 26 2014 at 8:23:08 PM Ben Wilson benwilson...@gmail.com wrote:
Hey folks, I've started writing some rust code lately and run into weird
behavior when benchmarking. When running
Doh, of course. Thanks, it's been a while since I've written low level
stuff.
On Wed, Nov 26, 2014 at 10:28 PM, Steven Fackler sfack...@gmail.com wrote:
The `nums` array is allocated on the stack and is 8 MB (assuming you're on
a 64 bit platform).
On Wed Nov 26 2014 at 8:23:08 PM Ben Wilson