Open
Conversation
DanielRosenwasser
approved these changes
Mar 30, 2026
Member
DanielRosenwasser
left a comment
There was a problem hiding this comment.
Some will work, some won't. But always learning.
Contributor
There was a problem hiding this comment.
Pull request overview
Renames the internal generic bump allocator type from core.Pool to core.Arena to better reflect its allocation semantics (arena/bump allocator rather than reusable pooling), and updates all call sites across the compiler and language service.
Changes:
- Replace
core.Pool[T]withcore.Arena[T]across the codebase and rename related struct fields (*Pool→*Arena). - Remove
internal/core/pool.goand introduceinternal/core/arena.gowith the same allocation API (New,NewSlice,NewSlice1,Clone). - Update
LinkStoreand other core subsystems (parser/checker/binder/AST factory/printer/sourcemap decoder) to allocate from arenas.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/sourcemap/decoder.go | Switch mapping allocation from Pool to Arena. |
| internal/printer/printer.go | Rename comment/source-map state allocators from pools to arenas. |
| internal/parser/reparser.go | Use nodeSliceArena for slice allocations during JSDoc reparsing. |
| internal/parser/parser.go | Rename parser slice allocators to arenas and update clone usage. |
| internal/parser/jsdoc.go | Use stringSliceArena / nodeSliceArena for JSDoc parsing allocations. |
| internal/core/pool.go | Remove old Pool[T] implementation. |
| internal/core/linkstore.go | Replace embedded Pool with Arena for stored values. |
| internal/core/arena.go | Add new Arena[T] implementation (renamed from Pool[T]). |
| internal/checker/checker.go | Replace checker pools (symbols/signatures/index info) with arenas. |
| internal/binder/binder.go | Replace binder pools (symbols/flow nodes/lists) with arenas. |
| internal/ast/ast.go | Replace NodeFactory pools with arenas for node allocations. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Somewhat of a nit but
Poolisn't exactly the right term, as it's really an arena or bump allocator.