Actually, it appears to be more to do with realloc and/or free rather than malloc per se, but also there seem to be some pretty strange things going on with respect to error handling.

I get the impression, but haven't got proof yet, that it may be something to do with the way Perl is using the CRT, possibly to do with how it handles errors.

Has anyone tried the OP code on a non-threaded 5.8.x Win32 build? There are lots ( literally millions) of repetitions of the call sequence:

... [T1868] GetLastError(2845dc, 18f5ca4, 77c35292, 2803000e, ...) = 3 [T1868] TlsGetValue(0, 2845dc, 18f5ca4, 77c35292, ...) = 281ea0 [T1868] SetLastError(3, 2845dc, 18f5ca4, 77c35292, ...) = 7ffde000 [T1868] GetLastError(2845dc, 18f5ca4, 77c35292, 2803000e, ...) = 3 [T1868] TlsGetValue(0, 2845dc, 18f5ca4, 77c35292, ...) = 281ea0 [T1868] SetLastError(3, 2845dc, 18f5ca4, 77c35292, ...) = 7ffde000 ...

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^3: Garbage collection problem?? (Win32 CRTL malloc) by BrowserUk
in thread Garbage collection problem?? by tcarmeli

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.