diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-02 20:00:13 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-02 20:00:13 -0400 |
| commit | 6e1425e3123855422068738f0911d5cac9bb0aef (patch) | |
| tree | fe9e93e40d174bafeb20b74e7da8ed79c562ac19 /std/atomic/stack.zig | |
| parent | dd627372660209cc5a8ab294d5811b97cd1f56f5 (diff) | |
| parent | 06e8c2e5194439ce5b66f18fcf60108604449957 (diff) | |
| download | zig-6e1425e3123855422068738f0911d5cac9bb0aef.tar.gz zig-6e1425e3123855422068738f0911d5cac9bb0aef.zip | |
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'std/atomic/stack.zig')
| -rw-r--r-- | std/atomic/stack.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/std/atomic/stack.zig b/std/atomic/stack.zig index 9e81d89257..d74bee8e8b 100644 --- a/std/atomic/stack.zig +++ b/std/atomic/stack.zig @@ -117,8 +117,10 @@ fn startPuts(ctx: *Context) u8 { while (put_count != 0) : (put_count -= 1) { std.os.time.sleep(0, 1); // let the os scheduler be our fuzz const x = @bitCast(i32, r.random.scalar(u32)); - const node = ctx.allocator.create(Stack(i32).Node) catch unreachable; - node.data = x; + const node = ctx.allocator.create(Stack(i32).Node{ + .next = undefined, + .data = x, + }) catch unreachable; ctx.stack.push(node); _ = @atomicRmw(isize, &ctx.put_sum, builtin.AtomicRmwOp.Add, x, AtomicOrder.SeqCst); } |
