assert in malloc.c:383

Karel Gardas kgardas at objectsecurity.com
Fri Jan 14 15:12:18 UTC 2005


Hello Bogdan,

there is small misunderstanding going here. When I asked if the assert(0)
in free is really needed, I meant something like `is this situation really
that critical that we should assert because of invalid invariant here'?
The reason is that sometime I found my own code to be too restrictive and
so some asserts might be removed during the later development phases,
hence I asked if this assert is not just relict from the history which
might be removed.

Thanks,
Karel

On Fri, 14 Jan 2005, Bogdan Vacaliuc wrote:

> > my question is: how to prevent it? Is assert on this place really needed,
> > especially when I consider that you set errno on this place. What does
>
> In regards to your question on whether assert() is really needed, please
> remember that assert() is typically (always!) a conditional macro, whose
> code is eliminated by the definition of _NDEBUG.  Its operation is generally
> a system halt with diagnostic output to enable you to identify the problem
> quickly.
>
> Code written with assert() should not *rely* on assert() as the error
> handling method; it is not that.  It is a *debugging* tool.
>
> Best Regards,
>
> -bogdan
>
>
>

--
Karel Gardas                  kgardas at objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com




More information about the users mailing list