free (NULL)

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Wed May 30 17:03:23 AEST 1990


In article <1739 at necisa.ho.necisa.oz>, boyd at necisa.ho.necisa.oz (Boyd Roberts) writes:
> In article <3078 at goanna.cs.rmit.oz.au> ok at goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
[when is it safe to deallocate something]

> Well, once you've coded yourself into a corner all bets are off.  Choose
> a better algorithm, one that has all the pointers in a free-able state.

Whether something is freeable is NOT a property of the algorithm which has
to make the immediate decision.  It is a property of the program that USES
the algorithm.  If you're writing a library function, you simply haven't
any control over the code that uses your function.

> I can't see there's much of a problem with the standard libraries.
The question had nothing to do with the standard libraries.

-- 
"A 7th class of programs, correct in every way, is believed to exist by a
few computer scientists.  However, no example could be found to include here."



More information about the Comp.lang.c mailing list