Repository navigation
Give the vtable SmallVectors an explicit inline size (Debug build C2338) - #713
Merged
Merged
Conversation
MethodInfo holds three std::strings and two std::vectors, which MSVC's Debug STL makes 8 bytes bigger each: VirtualMethodOrFieldInfo and VirtualMethodOrInterfaceVTableInfo go past SmallVector<T>'s 256-byte limit for a defaulted inline size, so the Debug build fails (C2338) while Release and CI build. An explicit N of 1 is what the default came to for these types, so nothing changes in Release; pair<Attribute, MethodInfo>, exactly 256 bytes in Debug, gets one too. MethodInfo's comments about keeping under that limit no longer apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The MSVC Debug build of
MLIRTypeScriptfailed withSmallVector.h(1171): error C2338: ... sizeof(T) is really big!. Release and CI build fine.MethodInfoholds threestd::strings and twostd::vectors. The MSVC Debug STL makes each of them 8 bytes bigger, soVirtualMethodOrFieldInfoandVirtualMethodOrInterfaceVTableInfogo past the 256-byte limitSmallVector<T>sets for a defaulted inline size, but only in Debug.SmallVectorof those two types now says, 1. That is what the default already came to for types this size, so Release is unchanged.SmallVector<std::pair<mlir::Attribute, MethodInfo>>is exactly 256 bytes in Debug, so it gets, 1too.MethodInfoabout keeping under that limit. They no longer apply.Verified: the Debug build of
MLIRTypeScript.vcxprojnow succeeds.🤖 Generated with Claude Code