🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #718

Re: Common malloc/free practice violates ANSI standard ?

#718
From: Doug Gwyn
Date: Mon, 16 Oct 1989 03:29
11 lines
1125 bytes
In article <1989Oct14.043811.669@anucsd.oz> bdm@anucsd.oz (Brendan McKay) writes:
>Note that I'm not claiming the Standard is broken, only that the writers of
>the standard have accidentally ruled out a common coding practice.

No, we didn't -- any valid pointer can be converted to a pointer that
has less strict alignment and back, so that the result compares equal
to the original pointer, void* has the same alignment requirement as
char*, and converting a coarsely-aligned malloc() void* to OBJ* does
NOT result in adjustment of the alignment.  Apply ALL the relevant
constraints and you'll find that there is no problem with typical
malloc()/free() usage.
Technical Details
Message-ID: <11294@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!aplcen!haven!adm!smoke!gwyn
References: <1989Oct14.043811.669@anucsd.oz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!aplcen!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: <11294@smoke.BRL.MIL>
Date: 16 Oct 89 03:29:33 GMT
References: <1989Oct14.043811.669@anucsd.oz>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 11