Path: utzoo!attcan!uunet!cs.utexas.edu!wuarchive!texbell!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: effect of free() Message-ID: <6117@ficc.uu.net> Date: 10 Sep 89 14:54:46 GMT References: <319@cubmol.BIO.COLUMBIA.EDU> <3756@buengc.BU.EDU> <2071@munnari.oz.au> Organization: Xenix Support, FICC Lines: 34 In article <2071@munnari.oz.au>, ok@cs.mu.oz.au (Richard O'Keefe) writes: > It's as if > p = 1; > printf("%d\n", p); > if (p == 0) > were allowed to blow up. Try this: foo = GetPointerToSharedMemory(); DeleteSharedMemory(); if(foo==0); There will always be cases like this. It just so happens that it may be desirable to make free() one of these cases. So the standard does not preclude it. > The problem with address loads trapping is not a hardware problem; it is a > hardware/OS problem. Yes. > I have outlined one approach which requires some OS > cooperation, but if the standard required the usual invariance property to > hold, OS vendors just might see an advantage in making C implementation > straightforward. The standard deliberately avoids doing this sort of thing. How about the limitation in significant characters in extyernal symbols? That one's much more irritating. -- Peter da Silva, *NIX support guy @ Ferranti International Controls Corporation. Biz: peter@ficc.uu.net, +1 713 274 5180. Fun: peter@sugar.hackercorp.com. `-_-' "...the TV reporters, who are as intelligent as electric toasters" 'U` -- Clayton E. Cramer