|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: [Win32] pthreads and memory allocationby Marshall (Prior) |
| on Nov 22, 2011 at 06:20 UTC ( #939374=note: print w/ replies, xml ) | Need Help?? |
|
I am having trouble understanding even the basics of this C code.
There is nothing returned from this C subroutine,
The OP's code is a memory leak because there is no pointer or other way to use the memory allocated by
"s" is a memory pointer returned by malloc(). Now a malloc() call should have a conditional statement to see that it actually worked. But the big thing here is that the subroutine TaskCode() returns bullshit. I don't see how "s", the pointer to a new memory allocation of 100 bytes can ever be used outside of TaskCode()
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||