diff options
| -rw-r--r-- | src/js_ast.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig index 11ff6e82f..350bf6561 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -117,6 +117,12 @@ pub fn NewBaseStore(comptime Union: anytype, comptime count: usize) type { return used; } + /// Reset all AST nodes, allowing the memory to be reused for the next parse. + /// Only call this when we're done with ALL AST nodes, or you risk + /// undefined memory bugs. + /// + /// Nested parsing should either use the same store, or call + /// Store.reclaim. pub fn reset() void { const blocks = _self.overflow.slice(); for (blocks) |b| { |
