At 3:33 PM -0500 1/16/04, Benjamin K. Stuhl wrote:
Dan Sugalski wrote:
I was going to go on about a few ways to do this, but after I did I realized that only one option is viable. So, let's try this on for size:

Vtables are chained. That means each vtable has a link to the next in the chain. It *also* means that each call into a vtable function has to pass in a pointer to the vtable the call came from so calls can be delegated properly. If we don't want this to suck down huge amounts of memory it also means that the vtable needs to be split into a vtable header and vtable function table body.

Downside there is that we have an extra parameter (somewhat pricey) to all the vtable functions.

This is sort of icky. What about dynamically constructing vtables and caching them?

How would one wrap a vtable, then? If you do this, there's no way to call back into the original (or earlier wrapping) entry.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to