On 19/09/16 10:11, Linus Nordberg wrote:
Proposed change: copy the variable to the heap and use this as argument to the new thread; also new thread is responsible for the memory if spawn is successful.
The argument is an integer. Is there anything wrong with just passing it as is? (Yes, I'm asking for review of branch 'stompless'. ;))
I would be concerned about portability here (thought issues might be very rare or even non-existent in the real world). Casting between pointer and int is implementation-defined and might not work on all platforms. [1] gives some explanation and reference to C99 standard.
BR Fabian
[1] http://stackoverflow.com/questions/8618637/what-does-it-mean-to-convert-int-...