diff options
| author | 2023-01-19 16:19:15 -0800 | |
|---|---|---|
| committer | 2023-01-19 16:19:15 -0800 | |
| commit | e04fe64a826fa0642e9fa91faaae898d488f8156 (patch) | |
| tree | 38f7203a7a2d857c11d669338acee16d412392d5 | |
| parent | 495c70053ff6823073e9bb5938f1fb41215a6919 (diff) | |
| download | bun-e04fe64a826fa0642e9fa91faaae898d488f8156.tar.gz bun-e04fe64a826fa0642e9fa91faaae898d488f8156.tar.zst bun-e04fe64a826fa0642e9fa91faaae898d488f8156.zip | |
Add a comment
| -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| { |
