But yes perl does redefine these things, ...
The problem is that those also get redefined at various points. See win32\win32iop.h. Sometimes, multiple times depending upon where you are in the source code.
And the allocator used under Windows is a custom allocator. See win32\vmem.h. (Though that is also dependent upon build-time options...)
It's all very convoluted to work out exactly what is being compiled.
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.
| [reply] |
The problem is that those also get redefined at various points
Aaaah ... it seems to be the old "#undef free" trick that's needed here.
The following rendition works fine for me on Strawberry:
void *thread(void *arg) {
#undef free
char *msg = (char*)arg;
printf("thread: %s\n", msg);
free(msg);
return NULL;
}
You can probably disregard my other post of a few minutes ago.
(By undeffing free, we get to call the free() that we want, not the the free() that perl defined for us.)
Cheers, Rob | [reply] [d/l] |
the old "#undef free" trick
I was reluctant to mention that as I am unfamiliar with the effects in a mingw environment.
(By undeffing free, we get to call the free() that we want, not the the free() that perl defined for us.)
It would be interesting to see the /E output after doing that?
I'm guessing that it gives your the CRT free(), but that then brings up the question:
If you need the CRT free(), what/where/how was the thing being freed, allocated?
I suspect you may have been on the right lines in your other post; and the problem is that actually, the OP is freeing the wrong thing. And the fact that by doing so using the CRT free() doesn't cause a crash is simply luck.
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.
| [reply] |