Skip to content

refactor(allocator): ChunkFooter store pointer to backing allocation#21865

Merged
graphite-app[bot] merged 1 commit into
mainfrom
om/04-26-refactor_allocator_chunkfooter_store_pointer_to_backing_allocation
Apr 27, 2026
Merged

refactor(allocator): ChunkFooter store pointer to backing allocation#21865
graphite-app[bot] merged 1 commit into
mainfrom
om/04-26-refactor_allocator_chunkfooter_store_pointer_to_backing_allocation

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Apr 27, 2026

Copy link
Copy Markdown
Member

Refactor to Arena.

ChunkFooter contained start_ptr, pointing to the start of the chunk. This pointer is the same one as start_ptr in Arena, but they serve different purposes. The one Arena is the boundary beyond which allocations cannot be made in chunk, the one in ChunkFooter is used for deallocating the chunk's memory.

Rename the field in ChunkFooter to backing_alloc_ptr, to reflect its purpose.

This is a step towards allowing the allocatable region of chunks to be cut from within a larger allocation, in order to support uncommitted memory backing Arena's chunks.

overlookmotel commented Apr 27, 2026

Copy link
Copy Markdown
Member Author

@codspeed-hq

codspeed-hq Bot commented Apr 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/04-26-refactor_allocator_chunkfooter_store_pointer_to_backing_allocation (76ee605) with main (e7f8d55)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (215e7ae) during the generation of this report, so e7f8d55 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel added C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior A-allocator Area - Allocator labels Apr 27, 2026
@overlookmotel overlookmotel marked this pull request as ready for review April 27, 2026 22:55
Copilot AI review requested due to automatic review settings April 27, 2026 22:55
@graphite-app

graphite-app Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Merge activity

#21865)

Refactor to `Arena`.

`ChunkFooter` contained `start_ptr`, pointing to the start of the chunk. This pointer is the same one as `start_ptr` in `Arena`, but they serve different purposes. The one `Arena` is the boundary beyond which allocations cannot be made in chunk, the one in `ChunkFooter` is used for deallocating the chunk's memory.

Rename the field in `ChunkFooter` to `backing_alloc_ptr`, to reflect its purpose.

This is a step towards allowing the allocatable region of chunks to be cut from within a larger allocation, in order to support uncommitted memory backing `Arena`'s chunks.
graphite-app Bot pushed a commit that referenced this pull request Apr 27, 2026
Refactor to `Arena`.

`Arena::new_chunk` return the chunk's start pointer directly, rather than the caller having to obtain it from the `ChunkFooter`.

This is a step towards separating the 2 pointers which live in `Arena` and `ChunkFooter`, continued in #21865.
@graphite-app graphite-app Bot force-pushed the om/04-26-refactor_allocator_arena_new_chunk_return_start_pointer branch from bc5bfbe to 215e7ae Compare April 27, 2026 23:32
@graphite-app graphite-app Bot force-pushed the om/04-26-refactor_allocator_chunkfooter_store_pointer_to_backing_allocation branch from 1a4aa2a to 76ee605 Compare April 27, 2026 23:32
graphite-app Bot pushed a commit that referenced this pull request Apr 27, 2026
…ointer in `ChunkFooter` (#21868)

Previously, fixed size allocators stored the pointer to the start of `Allocator`'s backing memory in `FixedSizeAllocatorMetadata`. Instead, store this pointer in `ChunkFooter`, in the field introduced in #21865.
Base automatically changed from om/04-26-refactor_allocator_arena_new_chunk_return_start_pointer to main April 27, 2026 23:38
@graphite-app graphite-app Bot merged commit 76ee605 into main Apr 27, 2026
38 checks passed
@graphite-app graphite-app Bot deleted the om/04-26-refactor_allocator_chunkfooter_store_pointer_to_backing_allocation branch April 27, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant