code: handle out of memory as well as possible

This commit is contained in:
Isaac Freund
2020-07-05 22:49:17 +02:00
parent 3752a7879b
commit 341fe1e977
10 changed files with 55 additions and 44 deletions

View File

@ -130,7 +130,7 @@ const ScanProtocolsStep = struct {
step: std.build.Step,
fn create(builder: *std.build.Builder) *ScanProtocolsStep {
const self = builder.allocator.create(ScanProtocolsStep) catch unreachable;
const self = builder.allocator.create(ScanProtocolsStep) catch @panic("out of memory");
self.* = init(builder);
return self;
}
@ -225,7 +225,7 @@ const ScdocStep = struct {
step: std.build.Step,
fn create(builder: *std.build.Builder) *ScdocStep {
const self = builder.allocator.create(ScdocStep) catch unreachable;
const self = builder.allocator.create(ScdocStep) catch @panic("out of memory");
self.* = init(builder);
return self;
}