Conversation
TurkeyMan
force-pushed
the
pr4_symbol_slices
branch
from
September 29, 2026 13:32
46d7c4a to
3dfe459
Compare
DMD perf check
All measurements
30a5e52 vs merge-base 10adc6c · about these metrics |
TurkeyMan
force-pushed
the
pr4_symbol_slices
branch
3 times, most recently
from
September 29, 2026 13:49
5bf9dcb to
599403a
Compare
…symbol slices __traits(vtblSymbol, T) is the vtbl of class T as a const(void*[]), and __traits(getInterfaces, T) is the Interface[] array of class or interface T as a const(Interface[]), i.e. the array the compiler places right after the ClassInfo. Like __traits(initSymbol, T) they are slices of symbols whose contents are only known at link time. CTFE now passes such slices through as opaque constants instead of erroring, so they can be stored (e.g. in a static initializer built at compile time), cast to another array type, and have their .length read; their contents still cannot be read.
TurkeyMan
force-pushed
the
pr4_symbol_slices
branch
from
September 29, 2026 14:25
599403a to
30a5e52
Compare
Contributor
Author
|
Oh, when did the spec get merged into DMD? What a luxury! |
Contributor
Author
|
It's pretty terrible that CI takes over an hour... |
Contributor
|
Terrible, but unsurprising. |
Contributor
|
What is the application of alternative ClassInfo? Better C++ interop? |
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.
I'm writing alternative ClassInfo, so these traits make it possible to name the relevant symbols.
A following PR will make ClassInfo defined by the runtime rather than compiler magic.
__traits(vtblSymbol, T) is the vtbl of T as const(void*[]), and __traits(getInterfaces, T) is the Interface[] array of class or interface T as const(Interface[]), i.e. the array the compiler places right after the ClassInfo. Like __traits(initSymbol, T) they are slices of symbols whose contents are only known at link time.
CTFE now passes such slices through as opaque constants instead of erroring, so they can be stored (e.g. in a static initializer built at compile time), cast to another array type, and have their .length read; their contents can't be read.