On Thu, 22 Nov 2007 10:35:21 -0800
"Mehmet Yavuz Selim Soyturk" (via RT)
<[EMAIL PROTECTED]> wrote:

> # New Ticket Created by  "Mehmet Yavuz Selim Soyturk" 
> # Please include the string:  [perl #47704]
> # in the subject line of all future correspondence about this issue. 
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=47704 >
> 
> 
> There is a memory leak with the STRING's. Next C code consumes more
> and more memory, but does not free it:
> 
> for(i=0;i<20000000;i++) {
>     string_from_literal(INTERP, "nothing");
> }

Hi,

Unless I'm mistaken, string_from_literal() is an allocation function.
The string it returns needs to be freed again, with a call to
string_cstring_free().  I think this is true for all of the
string_from_* functions.

If there's a memory leak here, it is not in string_from_literal(), but
rather, in the code that calls it.  I think the code you mentioned
in your previous ticket ([perl #47572]) is a good example of that.

Mark

Reply via email to