Article View: comp.std.c
Article #734Re: Common malloc/free practice violates ANSI standard ?
From: Doug Gwyn
Date: Fri, 20 Oct 1989 13:27
Date: Fri, 20 Oct 1989 13:27
14 lines
1222 bytes
1222 bytes
In article <646@targon.UUCP> andre@targon.UUCP (andre) writes: >The fact that you conclude that the pointer can be changed in value >when cast from void * to <type> * is wrong, because free() could never >know what pointer you used and thus howmany bytes back it much go to >find the pionters of the free list that probably precede your buffer. This refutation is wrong -- under the (INCORRECT) assumption that the original malloc()ed pointer has been rounded up by conversion to an object pointer, free() could still locate the correct chunk of memory to liberate, under certain reasonable implementation assumptions. However, an error in the refutation does not prove the original claim, which was mistaken all along.
Technical Details
Message-ID:
<11350@smoke.BRL.MIL>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!udel!haven!adm!smoke!gwynReferences:
<1989Oct14.043811.669@anucsd.oz> <646@targon.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!udel!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c,comp.lang.c Subject: Re: Common malloc/free practice violates ANSI standard ? Message-ID: <11350@smoke.BRL.MIL> Date: 20 Oct 89 13:27:50 GMT References: <1989Oct14.043811.669@anucsd.oz> <646@targon.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Followup-To: comp.std.c Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14