[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl6-internals
Subject:    Re: [svn:parrot] r40313 - in trunk: . config/gen/makefiles
From:       chromatic <chromatic () wgz ! org>
Date:       2009-07-31 2:33:13
Message-ID: 200907301933.13851.chromatic () wgz ! org
[Download RAW message or body]

On Tuesday 28 July 2009 13:39:11 cotto@svn.parrot.org wrote:

> Log:
> [pmc2c] make VTABLE function inheritance work between dynpmcs, plus a test
> (see TT #882) flh++ for reporting and the MethodEmitter.pm part of this
> patch

> --- trunk/lib/Parrot/Pmc2c/MethodEmitter.pm	Tue Jul 28 20:39:09
> 2009	(r40312) +++ trunk/lib/Parrot/Pmc2c/MethodEmitter.pm	Tue Jul 28
> 20:39:11 2009	(r40313) @@ -267,7 +267,16 @@
>              \bSUPER\b         # Macro: SUPER
>              \(\s*(.*?)\)      # capture argument list
>            }x,
> -            sub { "interp->vtables[$supertype]->$name(" .
> full_arguments($1) . ')' } +            sub {
> +              if($pmc->is_dynamic($super)) {
> +                return "Parrot_" . $super .
> +                  "_get_vtable(interp)->$name(" . full_arguments($1) .
> +                  ')';

That leaks memory on every affected vtable invocation; 
Parrot_<pmctype>_get_vtable (eventually) allocates a new VTABLE.

We could keep a cache of override function pointers and call them from a 
cache.  The array lookup there would be a lot cheaper than the function call, 
and it wouldn't leak memory.

-- c
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic