| author | |
| committer | |
| log | bd5dc75068dcfb3dcd6b8197ee5d941cacb15cb9 |
| tree | f93e3c132f2233afd8466d3999d346e9544952b4 |
| parent | 6015192fb62f4dac430a23227df21ab6368e8e07 |
7 files changed, 8 insertions(+), 12 deletions(-)
doc/langref.html.in+1-1| ... | ... | @@ -6368,7 +6368,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val |
| 6368 | 6368 | </p> |
| 6369 | 6369 | <p> |
| 6370 | 6370 | Zig has a general purpose allocator available to be imported |
| 6371 | with {#syntax#}std.heap.GeneralPurposeAllocator{#endsyntax#}. However, it is still recommended to | |
| 6371 | with {#syntax#}std.heap.DebugAllocator{#endsyntax#}. However, it is still recommended to | |
| 6372 | 6372 | follow the {#link|Choosing an Allocator#} guide. |
| 6373 | 6373 | </p> |
| 6374 | 6374 |
lib/compiler/aro/main.zig+1-1| ... | ... | @@ -13,7 +13,7 @@ const assembly_backend = @import("assembly_backend"); |
| 13 | 13 | var debug_allocator: std.heap.DebugAllocator(.{ |
| 14 | 14 | .stack_trace_frames = 0, |
| 15 | 15 | // A unique value so that when a default-constructed |
| 16 | // GeneralPurposeAllocator is incorrectly passed to testing allocator, or | |
| 16 | // DebugAllocator is incorrectly passed to testing allocator, or | |
| 17 | 17 | // vice versa, panic occurs. |
| 18 | 18 | .canary = @truncate(0xc647026dc6875134), |
| 19 | 19 | }) = .{}; |
lib/std/hash/benchmark.zig+1-1| ... | ... | @@ -440,7 +440,7 @@ pub fn main(init: std.process.Init) !void { |
| 440 | 440 | std.process.exit(1); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init; | |
| 443 | var gpa: std.heap.DebugAllocator(.{}) = .init; | |
| 444 | 444 | defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak"); |
| 445 | 445 | const allocator = gpa.allocator(); |
| 446 | 446 |
lib/std/heap.zig+1-5| ... | ... | @@ -19,10 +19,6 @@ pub const BrkAllocator = @import("heap/BrkAllocator.zig"); |
| 19 | 19 | pub const DebugAllocatorConfig = @import("heap/debug_allocator.zig").Config; |
| 20 | 20 | pub const DebugAllocator = @import("heap/debug_allocator.zig").DebugAllocator; |
| 21 | 21 | pub const Check = enum { ok, leak }; |
| 22 | /// Deprecated; to be removed after 0.14.0 is tagged. | |
| 23 | pub const GeneralPurposeAllocatorConfig = DebugAllocatorConfig; | |
| 24 | /// Deprecated; to be removed after 0.14.0 is tagged. | |
| 25 | pub const GeneralPurposeAllocator = DebugAllocator; | |
| 26 | 22 | |
| 27 | 23 | /// A memory pool that can allocate objects of a single type very quickly. |
| 28 | 24 | /// Use this when you need to allocate a lot of objects of the same type, |
| ... | ... | @@ -1006,7 +1002,7 @@ const page_size_max_default: ?usize = switch (builtin.os.tag) { |
| 1006 | 1002 | test { |
| 1007 | 1003 | _ = @import("heap/memory_pool.zig"); |
| 1008 | 1004 | _ = ArenaAllocator; |
| 1009 | _ = GeneralPurposeAllocator; | |
| 1005 | _ = DebugAllocator(.{}); | |
| 1010 | 1006 | _ = FixedBufferAllocator; |
| 1011 | 1007 | if (builtin.single_threaded) { |
| 1012 | 1008 | if (builtin.cpu.arch.isWasm() or (builtin.os.tag == .linux and !builtin.link_libc)) { |
lib/std/testing.zig+2-2| ... | ... | @@ -19,11 +19,11 @@ var base_allocator_instance = std.heap.FixedBufferAllocator.init(""); |
| 19 | 19 | |
| 20 | 20 | /// This should only be used in temporary test programs. |
| 21 | 21 | pub const allocator = allocator_instance.allocator(); |
| 22 | pub var allocator_instance: std.heap.GeneralPurposeAllocator(.{ | |
| 22 | pub var allocator_instance: std.heap.DebugAllocator(.{ | |
| 23 | 23 | .stack_trace_frames = if (std.debug.sys_can_stack_trace) 10 else 0, |
| 24 | 24 | .resize_stack_traces = true, |
| 25 | 25 | // A unique value so that when a default-constructed |
| 26 | // GeneralPurposeAllocator is incorrectly passed to testing allocator, or | |
| 26 | // DebugAllocator is incorrectly passed to testing allocator, or | |
| 27 | 27 | // vice versa, panic occurs. |
| 28 | 28 | .canary = @truncate(0x2731e675c3a701ba), |
| 29 | 29 | }) = b: { |
test/standalone/child_process/main.zig+1-1| ... | ... | @@ -3,7 +3,7 @@ const Io = std.Io; |
| 3 | 3 | |
| 4 | 4 | pub fn main(init: std.process.Init.Minimal) !void { |
| 5 | 5 | // make sure safety checks are enabled even in release modes |
| 6 | var gpa_state: std.heap.GeneralPurposeAllocator(.{ .safety = true }) = .{}; | |
| 6 | var gpa_state: std.heap.DebugAllocator(.{ .safety = true }) = .{}; | |
| 7 | 7 | defer if (gpa_state.deinit() != .ok) { |
| 8 | 8 | @panic("found memory leaks"); |
| 9 | 9 | }; |
tools/generate_c_size_and_align_checks.zig+1-1| ... | ... | @@ -26,7 +26,7 @@ fn cName(ty: std.Target.CType) []const u8 { |
| 26 | 26 | }; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | var general_purpose_allocator: std.heap.GeneralPurposeAllocator(.{}) = .init; | |
| 29 | var general_purpose_allocator: std.heap.DebugAllocator(.{}) = .init; | |
| 30 | 30 | |
| 31 | 31 | pub fn main(init: std.process.Init) !void { |
| 32 | 32 | const args = try init.minimal.args.toSlice(init.arena.allocator()); |