Glenn said:
> PNG_USE_RESULT seems to be unused. #:-)
It is there for the png_get_* functions - callers should be checking the result of those, and I believe all callers are. I left it out, though, because I want to discuss use of this more after 1.4.0 is released.
> PNG_ALLOCATED does not seem to do anything. How is that one
> supposed to be used?
It is used on png_malloc/png_calloc/png_malloc_warn and on all the png_create_{read/write}_struct functions. It tells the compiler that the function is returning new, unaliased, memory. This potentially helps optimization of all the *callers* of those functions. They aren't called much in the library.
Whether any of this information actually makes a difference (either in perf or code size) depends on the compiler, but it is always good to give the compiler more information (so long as it is correct). I trawled the gcc attributes for things that were obviously applicable within png.h and found the two I added - noreturn and malloc.
John Bowler <
jbowler@...>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
png-mng-implement mailing list
png-mng-implement@...
https://lists.sourceforge.net/lists/listinfo/png-mng-implement