[x264-devel] [PATCH] improve malloc checks to allow graceful exit on malloc failures
Loren Merritt
lorenm at u.washington.edu
Sun Jul 26 03:13:15 CEST 2009
On Sat, 25 Jul 2009, Steven Walters wrote:
> 2. due to the above occurring in a threaded function, add a new
> variable to x264_t to keep track of the exit value
> - IMO easier and safer than mallocing memory to pass to pthread_exit
> to be then retrieved at pthread_join to then be freed.
Who said anything about mallocing on pthread_exit? The value returned from
a thread, whether via return or pthread_exit, is a void*. But that doesn't
mean it has to be a pointer, you can just cast it to int.
IMO one cast is an acceptable cost for moving a variable from x264_t to
the stack.
--Loren Merritt
More information about the x264-devel
mailing list