Manual delegates
Vladimir Panteleev
thecybershadow.lists at gmail.com
Sun Sep 16 14:45:08 UTC 2018
On Sunday, 16 September 2018 at 14:12:27 UTC, Guillaume Piolat
wrote:
> Anyone has any information about the ABI of delegates?
>
> In particular how to call them with a particular "this"/frame
> pointer?
>
> To solve a hairy problem I need a delegate with a synthesized
> frame pointer.
> https://dpaste.dzfl.pl/cf44417c98f9
>
> The problem is that delegate forwarding seems to require GC
> closures. I want manually-managed closures.
Have a look at the implementation of toDelegate, which does
exactly this:
https://github.com/dlang/phobos/blob/v2.082.0/std/functional.d#L1463
More information about the Digitalmars-d-learn
mailing list