holy moly fix all the leaks

This commit is contained in:
Zack Radisic
2025-09-01 15:45:17 -07:00
parent 19b9c4a850
commit 03d1e48004
5 changed files with 41 additions and 22 deletions

View File

@@ -240,6 +240,12 @@ pub inline fn lenI(self: *MutableString) i32 {
return @as(i32, @intCast(self.list.items.len));
}
pub fn takeSlice(self: *MutableString) []u8 {
const out = self.list.items;
self.list = .{};
return out;
}
pub fn toOwnedSlice(self: *MutableString) []u8 {
return bun.handleOom(self.list.toOwnedSlice(self.allocator));
}