On Wed, 03 Mar 2010 01:00:46 -0500, Steve Teale
<[email protected]> wrote:
* Binding a delegate to a function pointer will always need a (dynamic)
thunk, because the function will have been invoked without any context
pointer and it's the thunk's responsibility to assign the correct
context pointer.
At present, D's way of handling delegates requires patching GCC for the
GDC implementation. If an ABI change was made it would be nice if it
fitted into the GCC trampoline model.
Steve
Um, how exactly? I just read the wikipedia page on GCC trampoline and it
a) targeted only at nested functions b) utilizes self-modifying code which
is disabled on any sensible platform c) would require dynamic allocation
and d) actually uses more memory than D's method. Some time ago there was
a link to an excellent article (by Walter? Don?) on different ways to do
this. I remember d's way coming out the best, but I've seemed to have lost
the link.