]> git.kaiwu.me - njs.git/commit
Parser: release temporary compilation memory
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 3 Sep 2026 15:53:03 +0000 (08:53 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Thu, 10 Sep 2026 03:11:04 +0000 (20:11 -0700)
commit1186361b4b8f638323067a7aa9932bf4c52e2e53
treecbdf5b4feae7ac5ea47358aea62d62eabce6e7e9
parentf689f722443fec1cf01d57490b09b42fb2ca123b
Parser: release temporary compilation memory

Create a pool for each parser invocation and allocate parser nodes, array-item
storage, continuations, preread tokens, and active labels from it.  Destroy the
pool after generation and on parser or generator failures.

Keep atoms, lambdas, regexp patterns, scopes, variables, bytecode, and runtime
constants in the VM pool.  Clear persistent scope AST roots before releasing
the temporary pool.
src/njs_function.c
src/njs_generator.c
src/njs_lexer.c
src/njs_lexer.h
src/njs_parser.c
src/njs_parser.h
src/njs_variable.c
src/njs_vm.c