On Thu, 2004-04-29 at 10:25, Leopold Toetsch wrote:

> I'm still thinking that we should reduce the amount of signatures. Some
> special pointer types could be ok, though, *if* we can find something
> for/against the in/out problem.

Brainstorming again, I had a bit of insight.

The real problem isn't the impedence mismatch between stack calls and
register calls.  It's that low-level values in Parrot I, N, and S
registers are too transient.

Would it be easier to require that all out parameters use PMCs instead
that are converted to their low-level types?  For example, for my
signature of:

        int SDLCALL TTF_SizeText(TTF_Font *font, const char *text, int *w, int
*h);

... instead of passing values in I5 and I6, I'd pass two PerlInt (or
ParrotInt or whatever) PMCs in P6 and P7.  If the NCI thunk could
convert these, I wouldn't need parameter reordering or anything as I'd
still have some way to get at the value.

I think that'd also be shorter than setting up a temporary struct.

I'm at work now (writing about video games -- yeah, you guys should hate
me today), so I don't really have time to wire up a test, but I don't
see any drawbacks at the moment.

-- c

Reply via email to