Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^9: XS: free() outside of the main thread causes crash on Windows

by BrowserUk (Patriarch)
on Sep 25, 2014 at 11:26 UTC ( [id://1101953]=note: print w/replies, xml ) Need Help??


in reply to Re^8: XS: free() outside of the main thread causes crash on Windows
in thread XS: free() outside of the main thread causes crash on Windows

It's about a megabyte of output ... too big for my scratchpad, I think ??

In general, if you move to the end of the file and then back up, you can isolate the few dozen lines that come from your files and ignore the bulk of the stuff that comes from the included header files.

But it's not necessary. The OP seems happy with the solution and its caveats.

I've just checked that char*msg, char*arg and char*thread_arg (which is the arg that was originally malloc()'d) all point to the same location - and they do. IIUC (not guaranteed), that means you can free the memory by calling free() on either one of the three.

Provided it was allocated using the crt malloc, it'll be fine. (The OPs use of #undef malloc should guarentee that.)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1101953]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2024-03-28 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found