llvm: remork memory management in emit

This commit is contained in:
Jacob Young
2024-02-24 23:33:03 +01:00
committed by Andrew Kelley
parent 55f437b92b
commit f6af773578
3 changed files with 65 additions and 70 deletions

View File

@@ -40,9 +40,9 @@ pub fn BitcodeWriter(comptime types: []const type) type {
self.buffer.deinit();
}
pub fn toSlice(self: BcWriter) []const u32 {
pub fn toOwnedSlice(self: *BcWriter) Error![]const u32 {
std.debug.assert(self.bit_count == 0);
return self.buffer.items;
return self.buffer.toOwnedSlice();
}
pub fn length(self: BcWriter) usize {