diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-09 22:06:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-09 22:06:47 -0400 |
| commit | ccef60a64033a25dbe2351c27f28257546b2ae5b (patch) | |
| tree | 67390c7e43f9852cf3786f2eed35ebf04e15510d /std/debug | |
| parent | 10cc49db1ca1f9b3ac63277c0742e05f6412f3c6 (diff) | |
| parent | c89aac85c440ea4cbccf1abdbd6acf84a33077e3 (diff) | |
| download | zig-ccef60a64033a25dbe2351c27f28257546b2ae5b.tar.gz zig-ccef60a64033a25dbe2351c27f28257546b2ae5b.zip | |
Merge pull request #1198 from ziglang/m-n-threading
M:N threading
Diffstat (limited to 'std/debug')
| -rw-r--r-- | std/debug/index.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/std/debug/index.zig b/std/debug/index.zig index 54a9af4b9e..3070e0b40b 100644 --- a/std/debug/index.zig +++ b/std/debug/index.zig @@ -12,6 +12,11 @@ const builtin = @import("builtin"); pub const FailingAllocator = @import("failing_allocator.zig").FailingAllocator; pub const failing_allocator = FailingAllocator.init(global_allocator, 0); +pub const runtime_safety = switch (builtin.mode) { + builtin.Mode.Debug, builtin.Mode.ReleaseSafe => true, + builtin.Mode.ReleaseFast, builtin.Mode.ReleaseSmall => false, +}; + /// Tries to write to stderr, unbuffered, and ignores any error returned. /// Does not append a newline. /// TODO atomic/multithread support @@ -1125,7 +1130,7 @@ fn readILeb128(in_stream: var) !i64 { /// This should only be used in temporary test programs. pub const global_allocator = &global_fixed_allocator.allocator; -var global_fixed_allocator = std.heap.FixedBufferAllocator.init(global_allocator_mem[0..]); +var global_fixed_allocator = std.heap.ThreadSafeFixedBufferAllocator.init(global_allocator_mem[0..]); var global_allocator_mem: [100 * 1024]u8 = undefined; // TODO make thread safe |
