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 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
> 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 wrote:
> Hey folks, I've started writing some rust code lately and run into weird
> behavior when benchmarking. When running
>
> https://gist.github.com/benw
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 ran
On 26/11/14 12:26 PM, grayfox wrote:
> Hey guys,
>
> I'm really new to Rust (actually I've looked on Rust the last 5 hours the
> first time) but I think I produced something that shouldn't be possible. From
> the pointer guide I know that the following code will not compile because in
> the end
This is sound- you aren't actually making more than one mutable reference here.
Stepping through the operations in your example:
1. i is a mutable pointer to an immutable memory location
2. Pass a pointer to i into `bar`, which can mutate `i`.
3. Deref that pointer so you have a copy of `i`, which
Hey guys,
I'm really new to Rust (actually I've looked on Rust the last 5 hours the first
time) but I think I produced something that shouldn't be possible. From the
pointer guide I know that the following code will not compile because in the
end I would have two mutable pointers to the same ad