On Thursday 10 July 2008 14:41:50 NotFound wrote:

> I changed the signature from PMC * to const PMC * in r29253, otherwise
> using it with const gives warings in C and fails in C++.
>
> What is the reason to have an interp parameter? Looks like an
> unnecessary overhead in a frequently used function.

Consistency with other external functions.  Perhaps one day PMCNULL won't be 
static but interpreter local.  Mostly consistency.

I'm not even sure it should be a function, internally.  Externally, fine -- 
that's the best we can do, I'm sure.

Internally, I have strong doubts that GCC will know how to inline it across 
compilation units, being that GCC can't optimize across compilation units.  
Normally the desire not to duplicate code would win, but I had a ~10% 
performance improvement turning PARROT_ASSERT into a macro from a function, 
and suspect that the performance hit of making this a function everywhere, 
even inside libparrot, will be greater.

-- c

Reply via email to