At 10:24 PM +0200 3/29/04, Leopold Toetsch wrote:
Dan Sugalski wrote:

At 8:16 PM +0200 3/29/04, Leopold Toetsch wrote:
Did you consider ussng PMCs as instead of plain function pointers. As outlined a NCI, C, and PASM Sub PMC would be equally just invoke()d.


Yeah, I did. You end up with a twofold problem there--not only do you have extra indirection but you've also got relatively fat entries in the table.

Indirection yes. But the entry is of course a pointer to a sub-like PMC. I think such PMCs (CSub, NCI, PASM-Sub) would be rather long-lived, so they could be constructed in the constant PMC pool. The overhead is only at construction time (at module load or such). The indirection remains (which is about one if () ). But this scheme needs just one table.
Second is symmetry: Currently only C code can register a C MMD function. If the function pointer is a PMC*, PASM code can register a C function (via NCI) or a PASM function too.

Sure, but if you've an NCI function you might as well directly register it and skip the extra indirection. :)


Anyway, it won't be too long before bytecode can register MMD functions, albeit only bytecode functions. I'll expose that API to C code as well while I'm at it.
--
Dan


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

Reply via email to