#898: r40313 introduces a memory leak
--------------------+-------------------------------------------------------
 Reporter:  cotto   |       Owner:  cotto
     Type:  bug     |      Status:  new  
 Priority:  normal  |   Milestone:       
Component:  core    |     Version:  1.4.0
 Severity:  medium  |    Keywords:       
     Lang:          |       Patch:       
 Platform:          |  
--------------------+-------------------------------------------------------

Comment(by cotto):

 The conditions to trigger this leak are pretty rare but it'd still be nice
 to fix it up.  The leak can only happen when a dynpmc (Foo) extends
 another dynpmc (Bar), and when one of Foo's VTABLE functions calls SUPER.
 In that case the following code is generated, which will leak one VTABLE*
 per invocation of that function.
 {{{
     /* from src/dynpmc/foo2.c; note that the returned value isn't freed.
 */
     INTVAL i = Parrot_Foo_get_vtable(interp)->get_integer(interp, _self);
 }}}

 This could cause significant leakage if any HLLs had dynpmcs that extended
 other dynpmcs and called SUPER, but in practice it only happens in that
 one dynpmc in src/dynpmcs, and that's only to test that this case works.

 The tricky part is that pmc2c needs to turn the "SUPER()" in something
 like INTVAL i = SUPER(); into a snippet that gets the parent's vtable,
 calls a function, frees the vtable and assigns the value to i (or
 otherwise dtrt).

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/898#comment:4>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to