Improve the OOP ABI
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Thu Sep 28 13:05:01 UTC 2023
On 29/09/2023 1:42 AM, deadalnix wrote:
> 1/ Downcast to final classes.
> ```d
> auto foo(A a) {
> return typeid(a) is typeid(B) ? a : null;
> }
> ```
TypeInfo isn't guaranteed to be unique to a process when dealing with
shared libraries. There is a strong chance it'll be duplicative.
So this won't work.
> 2/ Inline ClassInfo with the vtbl.
ClassInfo is an alias to TypeInfo_Class now. This indirection shouldn't
exist.
https://github.com/dlang/dmd/blob/a6285c26c0e04b9b3b1d40ae1c3200c834df1480/druntime/src/object.d#L1737
More information about the Digitalmars-d
mailing list