Looking for details of how interface method tables are implemented in D
user456
user456 at 123.de
Sat Jun 17 17:09:36 UTC 2023
On Saturday, 17 June 2023 at 12:34:41 UTC, Dibyendu Majumdar
wrote:
> Hi
>
> I am looking for details of how interface method dispatch works
> in D.
> I would be grateful for any documentation of code references I
> can lookup.
>
> In particular, I wanted to understand how similar / different
> the implementation is compared to Java.
>
> Regards
> Dibyendu
That is specified
[here](https://dlang.org/spec/abi.html#interfaces). So you have
additional dereference to access the vtbl of an interface (vs
class vtbl). Then an address is read in this table, cast to a
function type, then called like a standard virtual call.
More information about the Digitalmars-d
mailing list