mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-30 06:46:45 -04:00
conf: add 'tweak.pty-prefetch-buffer-size-kb' setting
This controls the size of the buffers used by the PTY reader thread. The default is 512KB, for now.
This commit is contained in:
parent
984d008250
commit
1b06486c98
4 changed files with 19 additions and 11 deletions
12
terminal.c
12
terminal.c
|
|
@ -317,12 +317,6 @@ ptmx_reader_thread(void *_term)
|
|||
amount = term->ptmx_read_buffer.size - len;
|
||||
}
|
||||
|
||||
/* TODO */
|
||||
if (amount == 0) {
|
||||
LOG_ERR("PTY read buffer full");
|
||||
abort();
|
||||
}
|
||||
|
||||
ssize_t count = read(term->ptmx, &buf[len], amount);
|
||||
if (count < 0) {
|
||||
LOG_ERRNO("failed to read from PTY");
|
||||
|
|
@ -904,10 +898,10 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper,
|
|||
.ptmx_read_buffer = {
|
||||
.event_fd = ptmx_event_fd,
|
||||
.idx = 0,
|
||||
.size = 4 * 1024 * 1024,
|
||||
.size = conf->tweak.pty_prefetch_size,
|
||||
.buf = {
|
||||
{.data = malloc(4 * 1024 * 1024), .len = 0},
|
||||
{.data = malloc(4 * 1024 * 1024), .len = 0},
|
||||
{.data = malloc(conf->tweak.pty_prefetch_size), .len = 0},
|
||||
{.data = malloc(conf->tweak.pty_prefetch_size), .len = 0},
|
||||
},
|
||||
},
|
||||
.ptmx_buffer = tll_init(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue