| author | |
| committer | |
| log | 43fba5ea83849ec901bb2cd4f98bd0222f51f7f6 |
| tree | 9f12b846b6463bfe3b7b06ec2000e825f595189b |
| parent | 1a998886c863a1829d649f196093f1058cd9cf13 |
| parent | 40d74e428759d473b1704878814bd4a25bb0245c |
| signature |
std.log: adjust default level for ReleaseSmall to include info + bonus cleanup4 files changed, 4 insertions(+), 5 deletions(-)
lib/std/heap.zig+1-1| ... | @@ -287,7 +287,7 @@ fn rawCAlloc( | ... | @@ -287,7 +287,7 @@ fn rawCAlloc( |
| 287 | ) ?[*]u8 { | 287 | ) ?[*]u8 { |
| 288 | _ = context; | 288 | _ = context; |
| 289 | _ = return_address; | 289 | _ = return_address; |
| 290 | assert(alignment.compare(.lte, comptime .fromByteUnits(@alignOf(std.c.max_align_t)))); | 290 | assert(alignment.compare(.lte, .of(std.c.max_align_t))); |
| 291 | // Note that this pointer cannot be aligncasted to max_align_t because if | 291 | // Note that this pointer cannot be aligncasted to max_align_t because if |
| 292 | // len is < max_align_t then the alignment can be smaller. For example, if | 292 | // len is < max_align_t then the alignment can be smaller. For example, if |
| 293 | // max_align_t is 16, but the user requests 8 bytes, there is no built-in | 293 | // max_align_t is 16, but the user requests 8 bytes, there is no built-in |
lib/std/heap/arena_allocator.zig+1-1| ... | @@ -42,7 +42,7 @@ pub const ArenaAllocator = struct { | ... | @@ -42,7 +42,7 @@ pub const ArenaAllocator = struct { |
| 42 | data: usize, | 42 | data: usize, |
| 43 | node: std.SinglyLinkedList.Node = .{}, | 43 | node: std.SinglyLinkedList.Node = .{}, |
| 44 | }; | 44 | }; |
| 45 | const BufNode_alignment: Alignment = .fromByteUnits(@alignOf(BufNode)); | 45 | const BufNode_alignment: Alignment = .of(BufNode); |
| 46 | 46 | ||
| 47 | pub fn init(child_allocator: Allocator) ArenaAllocator { | 47 | pub fn init(child_allocator: Allocator) ArenaAllocator { |
| 48 | return (State{}).promote(child_allocator); | 48 | return (State{}).promote(child_allocator); |
lib/std/log.zig+1-2| ... | @@ -101,8 +101,7 @@ pub const Level = enum { | ... | @@ -101,8 +101,7 @@ pub const Level = enum { |
| 101 | /// The default log level is based on build mode. | 101 | /// The default log level is based on build mode. |
| 102 | pub const default_level: Level = switch (builtin.mode) { | 102 | pub const default_level: Level = switch (builtin.mode) { |
| 103 | .Debug => .debug, | 103 | .Debug => .debug, |
| 104 | .ReleaseSafe => .info, | 104 | .ReleaseSafe, .ReleaseFast, .ReleaseSmall => .info, |
| 105 | .ReleaseFast, .ReleaseSmall => .err, | ||
| 106 | }; | 105 | }; |
| 107 | 106 | ||
| 108 | const level = std.options.log_level; | 107 | const level = std.options.log_level; |
lib/std/mem/Allocator.zig+1-1| ... | @@ -253,7 +253,7 @@ pub inline fn allocAdvancedWithRetAddr( | ... | @@ -253,7 +253,7 @@ pub inline fn allocAdvancedWithRetAddr( |
| 253 | n: usize, | 253 | n: usize, |
| 254 | return_address: usize, | 254 | return_address: usize, |
| 255 | ) Error![]align(if (alignment) |a| a.toByteUnits() else @alignOf(T)) T { | 255 | ) Error![]align(if (alignment) |a| a.toByteUnits() else @alignOf(T)) T { |
| 256 | const a = comptime (alignment orelse Alignment.fromByteUnits(@alignOf(T))); | 256 | const a = comptime (alignment orelse Alignment.of(T)); |
| 257 | const ptr: [*]align(a.toByteUnits()) T = @ptrCast(try self.allocWithSizeAndAlignment(@sizeOf(T), a, n, return_address)); | 257 | const ptr: [*]align(a.toByteUnits()) T = @ptrCast(try self.allocWithSizeAndAlignment(@sizeOf(T), a, n, return_address)); |
| 258 | return ptr[0..n]; | 258 | return ptr[0..n]; |
| 259 | } | 259 | } |