Skip to content

Commit 0a93cff

Browse files
authored
Merge pull request swiftlang#40914 from mikeash/slab-size-fix
[Reflection] Fix async task slab size calculation.
2 parents 968a7e6 + f3493bf commit 0a93cff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/Reflection/ReflectionContext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,8 +1372,8 @@ class ReflectionContext
13721372
Chunk.Length = Slab->CurrentOffset;
13731373
Chunk.Kind = AsyncTaskAllocationChunk::ChunkKind::Unknown;
13741374

1375-
// Total slab size is the slab's capacity plus the slab struct itself.
1376-
StoredPointer SlabSize = Slab->Capacity + sizeof(*Slab);
1375+
// Total slab size is the slab's capacity plus the header.
1376+
StoredPointer SlabSize = Slab->Capacity + HeaderSize;
13771377

13781378
return {llvm::None, {Slab->Next, SlabSize, {Chunk}}};
13791379
}

0 commit comments

Comments
 (0)