| ... | @@ -38,7 +38,7 @@ pub fn BitcodeWriter(comptime types: []const type) type { | ... | @@ -38,7 +38,7 @@ pub fn BitcodeWriter(comptime types: []const type) type { |
| 38 | }; | 38 | }; |
| 39 | } | 39 | } |
| 40 | | 40 | |
| 41 | pub fn deinit(self: BcWriter) void { | 41 | pub fn deinit(self: *BcWriter) void { |
| 42 | self.buffer.deinit(self.allocator); | 42 | self.buffer.deinit(self.allocator); |
| 43 | } | 43 | } |
| 44 | | 44 | |
| ... | @@ -145,7 +145,7 @@ pub fn BitcodeWriter(comptime types: []const type) type { | ... | @@ -145,7 +145,7 @@ pub fn BitcodeWriter(comptime types: []const type) type { |
| 145 | | 145 | |
| 146 | pub fn writeBlob(self: *BcWriter, blob: []const u8) Error!void { | 146 | pub fn writeBlob(self: *BcWriter, blob: []const u8) Error!void { |
| 147 | const blob_word_size = std.mem.alignForward(usize, blob.len, 4); | 147 | const blob_word_size = std.mem.alignForward(usize, blob.len, 4); |
| 148 | try self.buffer.ensureUnusedCapacity(blob_word_size + 1); | 148 | try self.buffer.ensureUnusedCapacity(self.allocator, blob_word_size + 1); |
| 149 | self.alignTo32() catch unreachable; | 149 | self.alignTo32() catch unreachable; |
| 150 | | 150 | |
| 151 | const slice = self.buffer.addManyAsSliceAssumeCapacity(blob_word_size / 4); | 151 | const slice = self.buffer.addManyAsSliceAssumeCapacity(blob_word_size / 4); |
| ... | @@ -157,7 +157,7 @@ pub fn BitcodeWriter(comptime types: []const type) type { | ... | @@ -157,7 +157,7 @@ pub fn BitcodeWriter(comptime types: []const type) type { |
| 157 | pub fn alignTo32(self: *BcWriter) Error!void { | 157 | pub fn alignTo32(self: *BcWriter) Error!void { |
| 158 | if (self.bit_count == 0) return; | 158 | if (self.bit_count == 0) return; |
| 159 | | 159 | |
| 160 | try self.buffer.append(std.mem.nativeToLittle(u32, self.bit_buffer)); | 160 | try self.buffer.append(self.allocator, std.mem.nativeToLittle(u32, self.bit_buffer)); |
| 161 | self.bit_buffer = 0; | 161 | self.bit_buffer = 0; |
| 162 | self.bit_count = 0; | 162 | self.bit_count = 0; |
| 163 | } | 163 | } |