aboutsummaryrefslogtreecommitdiff
path: root/std/debug/failing_allocator.zig
diff options
context:
space:
mode:
Diffstat (limited to 'std/debug/failing_allocator.zig')
-rw-r--r--std/debug/failing_allocator.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/std/debug/failing_allocator.zig b/std/debug/failing_allocator.zig
index cc5a8bc045..f876b7902d 100644
--- a/std/debug/failing_allocator.zig
+++ b/std/debug/failing_allocator.zig
@@ -28,7 +28,7 @@ pub const FailingAllocator = struct {
};
}
- fn alloc(allocator: &mem.Allocator, n: usize, alignment: u29) %[]u8 {
+ fn alloc(allocator: &mem.Allocator, n: usize, alignment: u29) ![]u8 {
const self = @fieldParentPtr(FailingAllocator, "allocator", allocator);
if (self.index == self.fail_index) {
return error.OutOfMemory;
@@ -39,7 +39,7 @@ pub const FailingAllocator = struct {
return result;
}
- fn realloc(allocator: &mem.Allocator, old_mem: []u8, new_size: usize, alignment: u29) %[]u8 {
+ fn realloc(allocator: &mem.Allocator, old_mem: []u8, new_size: usize, alignment: u29) ![]u8 {
const self = @fieldParentPtr(FailingAllocator, "allocator", allocator);
if (new_size <= old_mem.len) {
self.freed_bytes += old_mem.len - new_size;