Repository navigation
Split the chunk header into F14ChunkHeader; the empty chunk is a real header object (#2741) - #2741
Closed
DenisYaroshevskiy wants to merge 1 commit into
Closed
DenisYaroshevskiy wants to merge 1 commit into
DenisYaroshevskiy wants to merge 1 commit into
Conversation
Contributor
|
@DenisYaroshevskiy has exported this pull request. If you are a Meta employee, you can view the originating Diff in D130938727. |
… header object (meta#2741) Summary: The 16-byte chunk header (`tags_`, `control_`, `outboundOverflowCount_` and the overflow constants) moves into a non-template base `F14ChunkHeader`; `F14Chunk<Item>` derives from it. The empty instance becomes a single `inline constexpr F14ChunkHeader kF14EmptyChunkHeader`, and `F14Table::chunks_` points to the header. - `F14Table::chunks()` (fancy `ChunkPtr`) and `chunksToAddress()` (raw `Chunk*`) `static_cast` down to `F14Chunk<Item>`; the former `std::to_address(chunks_)` uses become `chunksToAddress()`. - `F14EmptyTagVector` / `getF14EmptyTagVector()` go away; `isEmptyInstance` / `capacityScale` read the chunk's own fields instead of `reinterpret_cast`ing the chunk to the tag vector. - `PackedChunkItemPtr` gets a defaulted default constructor and default member initializers (null); `packedBegin_` is initialized with `{}` instead of `ItemIter{}.pack()`. - The gdb pretty printer casts `chunks_` to the table's `Chunk` type. No `reinterpret_cast` of the empty instance remains. This prepares for `constexpr` default construction (next diff), which needs the empty-chunk address to be a constant expression. Reviewed By: yfeldblum Differential Revision: D130938727
DenisYaroshevskiy
force-pushed
the
export-D130938727
branch
from
November 10, 2026 23:35
8b660ac to
db3d7ba
Compare
Contributor
|
This pull request has been merged in e582654. |
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.
Summary:
The 16-byte chunk header (
tags_,control_,outboundOverflowCount_and the overflow constants) moves into a non-template baseF14ChunkHeader;F14Chunk<Item>derives from it. The empty instance becomes a singleinline constexpr F14ChunkHeader kF14EmptyChunkHeader, andF14Table::chunks_points to the header.F14Table::chunks()(fancyChunkPtr) andchunksToAddress()(rawChunk*)static_castdown toF14Chunk<Item>; the formerstd::to_address(chunks_)uses becomechunksToAddress().F14EmptyTagVector/getF14EmptyTagVector()go away;isEmptyInstance/capacityScaleread the chunk's own fields instead ofreinterpret_casting the chunk to the tag vector.PackedChunkItemPtrgets a defaulted default constructor and default member initializers (null);packedBegin_is initialized with{}instead ofItemIter{}.pack().chunks_to the table'sChunktype.No
reinterpret_castof the empty instance remains. This prepares forconstexprdefault construction (next diff), which needs the empty-chunk address to be a constant expression.Reviewed By: yfeldblum
Differential Revision: D130938727