1
0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-11-23 12:32:02 +01:00

Reduce default buffer on stack size

Fix segfaults on musl libc when ultrajson runs in a thread. On musl libc
the default thread stack size is only 80k so allocating a 128k buffer on
stack will guarantee a crash. There seems not to be any evident
performance benefit using big buffer on stack either so we just reduce
the default.

fixes #254
This commit is contained in:
Natanael Copa 2017-08-23 10:43:22 -07:00 committed by Hugo
parent 351197c3d8
commit 0f52df8f9b

@ -77,7 +77,7 @@ tree doesn't have cyclic references.
/* /*
Dictates and limits how much stack space for buffers UltraJSON will use before resorting to provided heap functions */ Dictates and limits how much stack space for buffers UltraJSON will use before resorting to provided heap functions */
#ifndef JSON_MAX_STACK_BUFFER_SIZE #ifndef JSON_MAX_STACK_BUFFER_SIZE
#define JSON_MAX_STACK_BUFFER_SIZE 131072 #define JSON_MAX_STACK_BUFFER_SIZE 1024
#endif #endif
#ifdef _WIN32 #ifdef _WIN32