Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!crdgw1!sungod!davidsen
From: davidsen@sungod.crd.ge.com (ody)
Newsgroups: comp.lang.c
Subject: Re: effect of free(...)
Message-ID: <1678@crdgw1.crd.ge.com>
Date: 15 Aug 89 13:37:17 GMT
References: <33994@apple.Apple.COM>
Sender: news@crdgw1.crd.ge.com
Reply-To: davidsen@crdos1.UUCP (bill davidsen)
Organization: General Electric Corp. R&D, Schenectady, NY
Lines: 16

In article <33994@apple.Apple.COM> landon@Apple.COM (Landon Dyer) writes:

| "Foo!" you cry, "It works FINE on my FrobCo Unix(tm) machine!"
| 
| Super.  It won't work anywhere else, and it might stop working on YOUR
| machine tomorrow.  DO IT RIGHT.

  Actually the problem is it won't work *everywhere* else. Use of free'd
space is a certain way to non-portability. And, since the topic was
brounght up, if you do a lot of malloc and free there is a good chance
that the data will be modified by the free when garbage collection turns
two adjacent small free blocks into one large block. I actually got
bitten by this once, when a typo resulted in use of the wrong pointer.
	bill davidsen		(davidsen@crdos1.crd.GE.COM)
  {uunet | philabs}!crdgw1!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me