Memory allocation/deallocation for tree? Any good way?

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Jan 11 04:54:38 AEST 1991


In article <14805 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
> In article <MCDANIEL.91Jan9102148 at dolphin.adi.com> mcdaniel at adi.com (Tim McDaniel) writes:
> >A free() that did nothing would satisfy ANSI C, ...
> Not strictly true, as the standard specifies that the storage is made
> available for subsequent allocation.  However, there is no strictly
> conforming way to test for this behavior.

Doesn't as-if kick in here? A conforming program cannot figure out that
a no-op is different from the definition of free(); therefore the no-op
works as if it were a free() satisfying the literal definition;
therefore the no-op is a valid implementation of free(). Where's the
mistake?

---Dan



More information about the Comp.lang.c mailing list