diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-20 17:33:49 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-06-20 17:33:49 -0400 |
| commit | 4eca75c53b4679e7e31df1505d22a5b618a2d797 (patch) | |
| tree | 1682c01aac310e445a68830545f670d121ac38ea /std/atomic/queue.zig | |
| parent | 55193cb13bbc69350474f6a66728319b41149274 (diff) | |
| parent | 85f928f8bff8c033f6ef0104d68b033669cb36e4 (diff) | |
| download | zig-4eca75c53b4679e7e31df1505d22a5b618a2d797.tar.gz zig-4eca75c53b4679e7e31df1505d22a5b618a2d797.zip | |
Merge branch 'kristate-stdmem-replace-create-with-construct'
Diffstat (limited to 'std/atomic/queue.zig')
| -rw-r--r-- | std/atomic/queue.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/std/atomic/queue.zig b/std/atomic/queue.zig index 3dc64dbea2..16dc9f6cc3 100644 --- a/std/atomic/queue.zig +++ b/std/atomic/queue.zig @@ -114,8 +114,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(Queue(i32).Node) catch unreachable; - node.data = x; + const node = ctx.allocator.create(Queue(i32).Node{ + .next = undefined, + .data = x, + }) catch unreachable; ctx.queue.put(node); _ = @atomicRmw(isize, &ctx.put_sum, builtin.AtomicRmwOp.Add, x, AtomicOrder.SeqCst); } |
