mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Rename allocator to gpa.
This commit is contained in:
parent
6bcf0066b1
commit
ee20305ec8
1 changed files with 3 additions and 3 deletions
|
|
@ -1,10 +1,10 @@
|
|||
const std = @import("std");
|
||||
|
||||
test "detect leak" {
|
||||
const allocator = std.testing.allocator;
|
||||
const gpa = std.testing.allocator;
|
||||
var list: std.ArrayList(u21) = .empty;
|
||||
// missing `defer list.deinit(allocator);`
|
||||
try list.append(allocator, '☔');
|
||||
// missing `defer list.deinit(gpa);`
|
||||
try list.append(gpa, '☔');
|
||||
|
||||
try std.testing.expect(list.items.len == 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue