Commit 5e0cb49
committed
Eliminate VLA for stack safety and portability
Variable-length arrays (VLAs) were banned from the Linux kernel starting
with 4.20 due to stack overflow risks and unpredictable stack usage.
This replaces the VLA in picosynth_process() with a fixed-size scratch
array bounded by PICOSYNTH_MAX_NODES (default 32).
Stack usage is now predictable: 128 bytes per voice processing call.1 parent b3b0dfd commit 5e0cb49
2 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
47 | 60 | | |
48 | 61 | | |
49 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| |||
475 | 478 | | |
476 | 479 | | |
477 | 480 | | |
478 | | - | |
| 481 | + | |
479 | 482 | | |
480 | 483 | | |
481 | 484 | | |
| |||
0 commit comments