From: Olaf v. d. S. <ml...@vd...> - 2011-10-30 16:32:58
|
On Wed, Oct 26, 2011 at 8:56 PM, John Bowler <joh...@gm...> wrote: > I don’t think it’s suitable for libpng because of the ‘malloc’ in the > middle, but it’s certainly suitable for copy and paste – after all, it isn’t What's wrong with the malloc? > libpng specific, it just uses ANSI-C. The problems are OS specific because > of the potential difference of (long int) from ftell() and (size_t) to > malloc(); that’s not a libpng issue. The fread part can be changed to use a > list of buffers as required to deal with this. Hmm, it might still be less optimal due to extra memory copies. -- Olaf |