# New Ticket Created by  "Richard Hundt" 
# Please include the string:  [perl #42105]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42105 >


Hi,

The following PMC leaks memory at about 55Mb/1000000 calls to `call()'

#include "parrot/parrot.h"

static INTVAL dynpmc_Foo;

pmclass Foo dynpmc {
    void class_init() {
        if (pass) {
            dynpmc_Foo = Parrot_PMC_typenum(INTERP, "Foo");

}
    }


    void assign_pmc(PMC *sub) {
        PMC_pmc_val(SELF) = sub;
    }

    PCCMETHOD void call() {
        PMC *sub = PMC_pmc_val(SELF);
        Parrot_runops_fromc(INTERP, sub);

}
}

Cheers,
Rich
0a1,20
> #include "parrot/parrot.h"
> 
> static INTVAL dynpmc_Foo;
> 
> pmclass Foo dynpmc group js_group {
>     void class_init() {
>         if (pass) {
>             dynpmc_Foo = Parrot_PMC_typenum(INTERP, "Foo");
>         }
>     }
> 
>     void assign_pmc(PMC *other) {
>         PMC_pmc_val(SELF) = other;
>     }
> 
>     PCCMETHOD void call() {
>         PMC *code = PMC_pmc_val(SELF);
>         Parrot_runops_fromc(INTERP, code);
>     }
> }

Reply via email to