On Monday 05 July 2010 at 09:35, khairul  wrote:

> Author: khairul
> --- branches/gsoc_instrument/src/dynpmc/instrumentvtable.pmc  Mon Jul  5 
15:36:03 2010   (r48010)
> +++ branches/gsoc_instrument/src/dynpmc/instrumentvtable.pmc  Mon Jul  5 
16:35:33 2010   (r48011)
> @@ -314,6 +314,27 @@
>          *instr = stub;
>      }
>  
> +        /* Convert vtable_str to a constant STRING so that it can be used 
as a key. */
> +        con_string = Parrot_str_to_cstring(INTERP, vtable_str);
> +        key        = CONST_STRING(INTERP, con_string);
> +        Parrot_free_cstring(con_string);

Late comment on this commit I know, but this only works by accident.  
CONST_STRING() by intent only works for literal C strings.  
Parrot_str_new_constant() works for STRINGs where something else manages the 
buffer memory through the lifecycle of the application.

In this particular case, nothing in the commit suggests the need for a 
constant STRING, so all of this code can go away.

-- c
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to