On Fri, Oct 01, 2010 at 07:58:23AM -0400, Ronald S. Bultje wrote:
Hi,
On Sep 30, 2010, at 9:30 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Thu, Sep 30, 2010 at 07:37:36PM -0400, Ronald S. Bultje wrote:
(Review would've been nice - what problem does this solve exactly?)
that of our code being filled with #undef NDEBUG hacks
the problem of asserts() that are in speed critical code (aka enabling them slows things down significantly) and asserts that are in speed uncritical paths being inseperable. The thing is a devel wants to enable the ones that have no speed effect most of the time but theres a good reason not to enable the asserts that slow the code down
This was discussed previously, no volunteers came forward to work on it. I knew mans would attack me when i commit no matter what i commit, i was a bit surprised to see your reply though.
I'm not necessarily attacking... But I need to know how (and how not) to use this, or I'll keep complaining about already-solved problems.
When do I use av_assert0/1/2()? What's the difference? How do I enable each separately or all together? I need a howto. ;-).
please explain me what is unclear and how i can clarify it av_assert0() is a assert check that is always enabled, its usefull for things the maintainer of a file want to be always checked. (like for example things that would lead to exploits or hard to debug problems would they fail) av_assert2() is intended for speed critical code, like for example checking that get/put_bits() dont go over the end of the allocated buffer which could lead to hard to reproduce crashes if it just goes a small amount over it av_assert1() lies between the 2, its for cases where the assert check does not cause slowdown but where it also does not appear to be overly important to the maintainer to always check it. i thought the documentation in assert.h was saying this clear enough. Suggestions to improve it are welcome To enable them, you have to wait until that part has been implemented, iam working on that [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Old school: Use the lowest level language in which you can solve the problem conveniently. New school: Use the highest level language in which the latest supercomputer can solve the problem without the user falling asleep waiting.