Skip to content

Commit

Permalink
be a bit more generous with some buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Jun 10, 2024
1 parent 4a3c5e8 commit 7600918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ static inline void apiGenerateJson(struct apiBuffer *buffer, int64_t now) {
char *end = buffer->json + alloc;

for (int i = 0; i < buffer->len; i++) {
if ((p + 2000) >= end) {
if ((p + 16 * 1024) >= end) {
int used = p - buffer->json;
alloc *= 2;
buffer->json = (char *) realloc(buffer->json, alloc);
Expand Down Expand Up @@ -2022,7 +2022,7 @@ struct char_buffer apiGenerateAircraftJson(threadpool_buffer_t *pbuffer) {

struct apiBuffer *buffer = &Modes.apiBuffer[flip];

ssize_t alloc = buffer->jsonLen + 2048;
ssize_t alloc = buffer->jsonLen + 8 * 1024;

char *buf = check_grow_threadpool_buffer_t(pbuffer, alloc);
char *p = buf;
Expand Down

0 comments on commit 7600918

Please sign in to comment.