On Sat, May 08, 2004 at 10:01:56AM +0200, Leopold Toetsch wrote:
> Nicholas Clark <[EMAIL PROTECTED]> wrote:
> 
> [ half second DODs ]
> 
> >   0.07   1266.73     0.86  9459863     0.00     0.13  get_free_object_df
> 
> >   0.05   1268.18     0.62 124063316     0.00     0.00  int_compare
> 
> Looking at these 2 lines: You got 9.5 million PMCs. That would be ok,
> *if* these actually got recycled. From the second line above I've to
> assume that all of these PMCs are anchored with C<Parrot_register_pmc>
> and are never released.

I checked. They're not. Well deduced.
The problem came down to me storing not the PMC pointer, but the 1's complement
of it in the perl SV. This worked very well at making ponie SEGV whenever it
was about to take a PMC pointer, cast it to some sort of perl structure, and
then merrily try and access that memory.

However, I forgot to do the 1's complement on the value passed to the
unregister PMC call, and that doesn't SEGV if you pass it a duff value, so
I never realised my bug.

So I've fixed that and now it all runs in reasonable time. (As for all its
inherent horrors, perl's reference counting pretty much gets it right as to
when it's time to free up something)

Nicholas Clark

Reply via email to