Discussion on IRC today about how we can improve the state of the GC system. One of the things that came up was that perhaps we shouldn't be poking inside PMC guts outside of src/*pmc/: instead, we should be using vtable access.

I currently see ~500 instances where we use PMC_data() outside pmc code (after a build, so probably some generated code in there.)

I think if we had an example of how these should be fixed, that'd help others contribute, so, lets pick one and dissect it.

Here's a function from src/key.c :

/*

FUNCDOC: key_next
Returns the next key if C<key> is in a sequence of linked keys.

*/

PARROT_API
PMC *
key_next(SHIM_INTERP, PMC *key /*NN*/)
{
    return key->pmc_ext ? (PMC *)PMC_data(key) : NULL;
}

Is this in need of fixing? If so, how? If not, is there a better function to show off what needs fixing?


--
Will "Coke" Coleda
[EMAIL PROTECTED]


Reply via email to