Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^5: [Win32] pthreads and memory allocation

by BrowserUk (Pope)
on Nov 22, 2011 at 09:21 UTC ( #939399=note: print w/replies, xml ) Need Help??

in reply to Re^4: [Win32] pthreads and memory allocation
in thread [Win32] pthreads and memory allocation

Ooow .... I like *that* idea :-) I've actually placed the '#undef malloc' at the very start of the C code in that script, and the script now runs fine.

I've had some success with doing that to avoid PerlAPI interfering in stuff that is none of its business.

But be careful. You can find yourself in the 'multiple C runtimes' trap passing pointers allocated by one to another to be freed with various possibilities of outcome.

BTW. You should also be very wary of passing pointers to memory allocated on the stack of one thread as the thread argument to another. I realise it was only demo code, but it's worth a heads up.

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.
  • Comment on Re^5: [Win32] pthreads and memory allocation

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939399]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2018-04-21 18:35 GMT
Find Nodes?
    Voting Booth?