Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ Bytes readback_bytes(Net* net, Book* book, Port port) {
if (ctr.args_len != 2) break;
if (get_tag(ctr.args_buf[0]) != NUM) break;

if (bytes.len == capacity - 1) {
capacity *= 2;
if (bytes.len + 16 >= capacity) { // Grow in larger increments
capacity *= 2 + 128; // Avoid frequent realloc
bytes.buf = realloc(bytes.buf, capacity);
}

Expand Down