aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-ujson/lower-stack-usage.patch
blob: de3258cfdeb4daad25d18199b14ccfe24ce27faa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From: Shiz <hi@shiz.me>
Bug-Report: https://github.com/esnme/ultrajson/issues/254

musl default thread size is 80 kiB, so using 128 kiB by default will
overflow the stack and cause segmentation faults.

Allocating 128 kiB on the stack is a rather bad idea anyway, so we'll
lower it to 8 kiB.
--- ultrajson-1.35/lib/ultrajson.h
+++ ultrajson-1.35-patched/lib/ultrajson.h
@@ -77,7 +77,7 @@
 /*
 Dictates and limits how much stack space for buffers UltraJSON will use before resorting to provided heap functions */
 #ifndef JSON_MAX_STACK_BUFFER_SIZE
-#define JSON_MAX_STACK_BUFFER_SIZE 131072
+#define JSON_MAX_STACK_BUFFER_SIZE 8192
 #endif
 
 #ifdef _WIN32