mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
holy moly fix all the leaks
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user