struct Config [src]
Fields
fail_index: usize = std.math.maxInt(usize)The number of successful allocations you can expect from this allocator.
The next allocation will fail. For example, with fail_index equal to
2, the following test will pass:
var a = try failing_alloc.create(i32);
var b = try failing_alloc.create(i32);
testing.expectError(error.OutOfMemory, failing_alloc.create(i32));
resize_fail_index: usize = std.math.maxInt(usize)Number of successful resizes to expect from this allocator. The next resize will fail.
Source
pub const Config = struct {
/// The number of successful allocations you can expect from this allocator.
/// The next allocation will fail. For example, with `fail_index` equal to
/// 2, the following test will pass:
///
/// var a = try failing_alloc.create(i32);
/// var b = try failing_alloc.create(i32);
/// testing.expectError(error.OutOfMemory, failing_alloc.create(i32));
fail_index: usize = std.math.maxInt(usize),
/// Number of successful resizes to expect from this allocator. The next resize will fail.
resize_fail_index: usize = std.math.maxInt(usize),
}