mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
termio: allow write req pool to grow if needed
This may be necessary if large amounts of data is being written (i.e. a large clipboard paste). The pool is never shrunk again for now but once the writes go through the buffer items will of course be reused so its unlikely to need to continue growing.
This commit is contained in:
@ -233,8 +233,8 @@ pub inline fn queueWrite(self: *Exec, data: []const u8) !void {
|
||||
// our cached buffers that we can queue to the stream.
|
||||
var i: usize = 0;
|
||||
while (i < data.len) {
|
||||
const req = try ev.write_req_pool.get();
|
||||
const buf = try ev.write_buf_pool.get();
|
||||
const req = try ev.write_req_pool.getGrow(self.alloc);
|
||||
const buf = try ev.write_buf_pool.getGrow(self.alloc);
|
||||
const end = @min(data.len, i + buf.len);
|
||||
fastmem.copy(u8, buf, data[i..end]);
|
||||
ev.data_stream.queueWrite(
|
||||
|
Reference in New Issue
Block a user