Refactor Config_Web to use heap-allocated JSON document and add stack usage check script

This commit is contained in:
2026-03-07 18:43:17 +01:00
parent c9678e16cd
commit fedeeea9cb
2 changed files with 25 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
if rg -n '^[[:space:]]+StaticJsonDocument<kConfigJsonCapacity>[[:space:]]+[A-Za-z_][A-Za-z0-9_]*;' src/Config_Web.cpp; then
echo "Config_Web.cpp still allocates kConfigJsonCapacity-sized StaticJsonDocument on the stack" >&2
exit 1
fi
echo "Config_Web.cpp avoids stack-local kConfigJsonCapacity StaticJsonDocument allocations"