effect of free()

Peter da Silva peter at ficc.uu.net
Mon Sep 11 00:54:46 AEST 1989


In article <2071 at munnari.oz.au>, ok at 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 at ficc.uu.net, +1 713 274 5180. Fun: peter at sugar.hackercorp.com. `-_-'
"...the TV reporters, who are as intelligent as electric toasters"         'U`
	-- Clayton E. Cramer



More information about the Comp.lang.c mailing list