aboutsummaryrefslogtreecommitdiff
path: root/std/packed_int_array.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-06-23 01:29:48 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-06-23 01:29:48 -0400
commit036cc48a829ff4625394995fbe22b7a884370103 (patch)
tree9776349a355575ffc75d7503ca7ebfe3469ba49c /std/packed_int_array.zig
parent5e58aa4884995476179f5e74014c16f771e61ba3 (diff)
parent9153b17c922e3166a824d300781ca4e6da015787 (diff)
downloadzig-036cc48a829ff4625394995fbe22b7a884370103.tar.gz
zig-036cc48a829ff4625394995fbe22b7a884370103.zip
Merge remote-tracking branch 'origin/master' into copy-elision-3
Diffstat (limited to 'std/packed_int_array.zig')
-rw-r--r--std/packed_int_array.zig13
1 files changed, 5 insertions, 8 deletions
diff --git a/std/packed_int_array.zig b/std/packed_int_array.zig
index ffca88b53b..5cbab2d33b 100644
--- a/std/packed_int_array.zig
+++ b/std/packed_int_array.zig
@@ -603,8 +603,7 @@ test "PackedInt(Array/Slice)Endian" {
}
//@NOTE: Need to manually update this list as more posix os's get
-// added to DirectAllocator. Windows can be added too when DirectAllocator
-// switches to VirtualAlloc.
+// added to DirectAllocator.
//These tests prove we aren't accidentally accessing memory past
// the end of the array/slice by placing it at the end of a page
@@ -613,7 +612,7 @@ test "PackedInt(Array/Slice)Endian" {
// don't account for the bounds.
test "PackedIntArray at end of available memory" {
switch (builtin.os) {
- .linux, .macosx, .ios, .freebsd, .netbsd => {},
+ .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},
else => return,
}
const PackedArray = PackedIntArray(u3, 8);
@@ -623,8 +622,7 @@ test "PackedIntArray at end of available memory" {
p: PackedArray,
};
- var da = std.heap.DirectAllocator.init();
- const allocator = &da.allocator;
+ const allocator = std.heap.direct_allocator;
var pad = try allocator.create(Padded);
defer allocator.destroy(pad);
@@ -633,13 +631,12 @@ test "PackedIntArray at end of available memory" {
test "PackedIntSlice at end of available memory" {
switch (builtin.os) {
- .linux, .macosx, .ios, .freebsd, .netbsd => {},
+ .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {},
else => return,
}
const PackedSlice = PackedIntSlice(u11);
- var da = std.heap.DirectAllocator.init();
- const allocator = &da.allocator;
+ const allocator = std.heap.direct_allocator;
var page = try allocator.alloc(u8, std.mem.page_size);
defer allocator.free(page);