be much less memory greedy - json2tsv - JSON to TSV converter
HTML git clone git://git.codemadness.org/json2tsv
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 92f3832c6fb144de7a13d962327128368912907b
DIR parent 058bab370580f79697a492b58a8547a5deae6e64
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 14 Oct 2019 22:49:46 +0200
be much less memory greedy
Diffstat:
M json2tsv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
DIR diff --git a/json2tsv.c b/json2tsv.c
@@ -88,10 +88,10 @@ capacity(char **value, size_t *sz, size_t cur, size_t inc)
need = cur + inc;
if (need > *sz) {
- if (need > SIZE_MAX - 16384) {
+ if (need > SIZE_MAX - 4096) {
newsiz = SIZE_MAX;
} else {
- for (newsiz = *sz; newsiz < need; newsiz += 16384)
+ for (newsiz = *sz; newsiz < need; newsiz += 4096)
;
}
if (!(newp = realloc(*value, newsiz)))