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.)
|
|---|