Parse the config file on arenas

read_jconf now reads the file and builds the JSON tree in a scratch arena
that is released before it returns, and copies the parsed strings into one
process-lifetime arena instead of a malloc per string. parse_addr and the
config parser share one address splitter.

Port test_jconf to C++ and cover every field copied out of the parse tree,
a re-read, and the densest file the size limit accepts.
This commit is contained in:
Max Lv
2026-10-15 01:33:51 +08:00
parent fad7c44d43
commit 5f47a65c51
4 changed files with 360 additions and 253 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
# violations, and also when it loses some, so the number here always goes
# down. Remove a file once it is rewritten on the src/core primitives.
src/ipset.cpp 3
src/jconf.cpp 16
src/jconf.cpp 6
src/json.cpp 2
src/local.cpp 1
src/manager.cpp 14