assert in malloc.c:383
Bogdan Vacaliuc
bvacaliuc at ngit.com
Fri Jan 14 16:03:39 UTC 2005
Hi Karel, Everyone,
My apologies; I did not mean to insult your intelligence by my incorrect
interpretation of your comment. I do not have the depth of history with
this list, but I thought I would add that bit for completeness, as it
occured to me while reading the thread.
Your comments are well taken.
Best Regards,
-bogdan
Karel Gardas wrote:
> 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