mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Reflection] Fix async task slab size calculation.
The calculation failed to account for padding after the slab struct itself. We already account for this padding in HeaderSize, so use that instead of the raw struct size. rdar://87607280
This commit is contained in:
@@ -1372,8 +1372,8 @@ public:
|
||||
Chunk.Length = Slab->CurrentOffset;
|
||||
Chunk.Kind = AsyncTaskAllocationChunk::ChunkKind::Unknown;
|
||||
|
||||
// Total slab size is the slab's capacity plus the slab struct itself.
|
||||
StoredPointer SlabSize = Slab->Capacity + sizeof(*Slab);
|
||||
// Total slab size is the slab's capacity plus the header.
|
||||
StoredPointer SlabSize = Slab->Capacity + HeaderSize;
|
||||
|
||||
return {llvm::None, {Slab->Next, SlabSize, {Chunk}}};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user