| ... | ... | @@ -280,7 +280,8 @@ pub const HeapAllocator = switch (builtin.os) { |
| 280 | 280 | const amt = n + alignment + @sizeOf(usize); |
| 281 | 281 | const optional_heap_handle = @atomicLoad(?HeapHandle, &self.heap_handle, builtin.AtomicOrder.SeqCst); |
| 282 | 282 | const heap_handle = optional_heap_handle orelse blk: { |
| 283 | | const hh = os.windows.HeapCreate(0, amt, 0) orelse return error.OutOfMemory; |
| 283 | const options = if (builtin.single_threaded) os.windows.HEAP_NO_SERIALIZE else 0; |
| 284 | const hh = os.windows.HeapCreate(options, amt, 0) orelse return error.OutOfMemory; |
| 284 | 285 | const other_hh = @cmpxchgStrong(?HeapHandle, &self.heap_handle, null, hh, builtin.AtomicOrder.SeqCst, builtin.AtomicOrder.SeqCst) orelse break :blk hh; |
| 285 | 286 | _ = os.windows.HeapDestroy(hh); |
| 286 | 287 | break :blk other_hh.?; // can't be null because of the cmpxchg |