Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#70 Delete unnecessary null pointer checks

closed
Josh Coalson
libFLAC (10)
5
2007-07-26
2007-03-09
Markus Elfring
No

I guess that checks for pointers like "buffer" in the functions "FLAC__bitreader_free" and "FLAC__bitwriter_free" are not needed.
http://opengroup.org/onlinepubs/009695399/functions/free.html
http://flac.cvs.sourceforge.net/flac/flac/src/libFLAC/bitreader.c?revision=1.6&view=markup
http://flac.cvs.sourceforge.net/flac/flac/src/libFLAC/bitwriter.c?revision=1.8&view=markup

Will the deletion of such unnecessary instructions result in measurable improvements for execution speed?

Discussion

  • Josh Coalson
    Josh Coalson
    2007-07-26

    • assigned_to: nobody --> jcoalson
    • status: open --> closed
     
  • Josh Coalson
    Josh Coalson
    2007-07-26

    Logged In: YES
    user_id=78173
    Originator: NO

    no, it won't speed things up. I keep it there as a defense against buggy libc's even though this bug is probably pretty rare.