This repository was archived by the owner on Oct 12, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 420
TypeInfo_Struct: Switch to stored mangled name & demangle lazily (with per-thread cache) #3527
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ad78e67
TypeInfo_Struct: Switch to stored mangled name & demangle lazily (wit…
kinke 92e5c1b
[temp] Cirrus CI: Use same-named dmd branch
kinke 7e760cd
Avoid deadlock with PRINTF GC debugging
kinke 68c5f99
Re-add `pure` to `toString()` of TypeInfo subclasses wherever possible
kinke 9a30e97
Add changelog entry
kinke 04e0258
Azure Pipelines: Try to use same-named DMD branch for PRs originating…
kinke cd591f4
Cirrus CI: Try to use same-named DMD/Phobos branches for PRs originat…
kinke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
TypeInfo names for aggregates are fully qualified and hence unique now | ||
|
||
Previously, template arguments weren't fully qualified; they now are, | ||
implying longer names in that case. | ||
|
||
`TypeInfo_Struct` instances now store the (potentially significantly shorter) | ||
mangled name only and demangle it lazily on the first `name` or `toString()` | ||
call (with a per-thread cache). So if you only need a unique string per | ||
struct TypeInfo, prefer `mangledName` over computed `name` (non-`@nogc` and | ||
non-`pure`). | ||
|
||
**Related breaking change**: `TypeInfo.toString()` isn't `pure` anymore to | ||
account for the `TypeInfo_Struct` demangled name cache. | ||
`TypeInfo_Class.toString()` and others are still `pure`. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -464,12 +464,12 @@ class TypeInfo_v : TypeInfoGeneric!ubyte | |
{ | ||
return 1; | ||
} | ||
} | ||
|
||
unittest | ||
{ | ||
assert(typeid(void).toString == "void"); | ||
assert(typeid(void).flags == 1); | ||
} | ||
unittest | ||
{ | ||
assert(typeid(void).toString == "void"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
assert(typeid(void).flags == 1); | ||
} | ||
|
||
// All integrals. | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeInfo.opCmp
usestoString()
too; I'm not convinced overriding it here to check for aTypeInfo_Struct
rhs and comparing themangledName
instead is worth it.