diff options
Diffstat (limited to 'lib/std/atomic')
| -rw-r--r-- | lib/std/atomic/Atomic.zig | 2 | ||||
| -rw-r--r-- | lib/std/atomic/queue.zig | 4 | ||||
| -rw-r--r-- | lib/std/atomic/stack.zig | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/atomic/Atomic.zig b/lib/std/atomic/Atomic.zig index e38ada0c20..892e9633d5 100644 --- a/lib/std/atomic/Atomic.zig +++ b/lib/std/atomic/Atomic.zig @@ -125,7 +125,7 @@ pub fn Atomic(comptime T: type) type { @compileError(@tagName(Ordering.Unordered) ++ " is only allowed on atomic loads and stores"); } - comptime var success_is_stronger = switch (failure) { + const success_is_stronger = switch (failure) { .SeqCst => success == .SeqCst, .AcqRel => @compileError(@tagName(failure) ++ " implies " ++ @tagName(Ordering.Release) ++ " which is only allowed on success"), .Acquire => success == .SeqCst or success == .AcqRel or success == .Acquire, diff --git a/lib/std/atomic/queue.zig b/lib/std/atomic/queue.zig index e8d37507d3..552f2f9510 100644 --- a/lib/std/atomic/queue.zig +++ b/lib/std/atomic/queue.zig @@ -175,11 +175,11 @@ const puts_per_thread = 500; const put_thread_count = 3; test "std.atomic.Queue" { - var plenty_of_memory = try std.heap.page_allocator.alloc(u8, 300 * 1024); + const plenty_of_memory = try std.heap.page_allocator.alloc(u8, 300 * 1024); defer std.heap.page_allocator.free(plenty_of_memory); var fixed_buffer_allocator = std.heap.FixedBufferAllocator.init(plenty_of_memory); - var a = fixed_buffer_allocator.threadSafeAllocator(); + const a = fixed_buffer_allocator.threadSafeAllocator(); var queue = Queue(i32).init(); var context = Context{ diff --git a/lib/std/atomic/stack.zig b/lib/std/atomic/stack.zig index 1f19869fd6..0fc622cf63 100644 --- a/lib/std/atomic/stack.zig +++ b/lib/std/atomic/stack.zig @@ -85,11 +85,11 @@ const puts_per_thread = 500; const put_thread_count = 3; test "std.atomic.stack" { - var plenty_of_memory = try std.heap.page_allocator.alloc(u8, 300 * 1024); + const plenty_of_memory = try std.heap.page_allocator.alloc(u8, 300 * 1024); defer std.heap.page_allocator.free(plenty_of_memory); var fixed_buffer_allocator = std.heap.FixedBufferAllocator.init(plenty_of_memory); - var a = fixed_buffer_allocator.threadSafeAllocator(); + const a = fixed_buffer_allocator.threadSafeAllocator(); var stack = Stack(i32).init(); var context = Context{ |
