Skip to content

Rename core.Pool to core.Arena#3300

Open
jakebailey wants to merge 2 commits intomainfrom
jabaile/pool-rename-to-arena
Open

Rename core.Pool to core.Arena#3300
jakebailey wants to merge 2 commits intomainfrom
jabaile/pool-rename-to-arena

Conversation

@jakebailey
Copy link
Copy Markdown
Member

Somewhat of a nit but Pool isn't exactly the right term, as it's really an arena or bump allocator.

Copy link
Copy Markdown
Member

@DanielRosenwasser DanielRosenwasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some will work, some won't. But always learning.

@jakebailey jakebailey marked this pull request as ready for review April 3, 2026 17:04
Copilot AI review requested due to automatic review settings April 3, 2026 17:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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] with core.Arena[T] across the codebase and rename related struct fields (*Pool*Arena).
  • Remove internal/core/pool.go and introduce internal/core/arena.go with the same allocation API (New, NewSlice, NewSlice1, Clone).
  • Update LinkStore and 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants