Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sun-barr!ccut!kogwy!new1!roger From: roger@zuken.co.jp (Roger Meunier) Newsgroups: comp.lang.c++ Subject: Re: Zortech Problem: heap corrupted Message-ID: Date: 9 Aug 90 14:14:58 GMT References: <24059.26BA6CC2@stjhmc.fidonet.org> <2613@dataio.Data-IO.COM> Sender: news@new1.zuken.co.jp Organization: ZUKEN Inc. Yokohama, JAPAN Lines: 23 In-reply-to: bright@Data-IO.COM's message of 6 Aug 90 18:14:03 GMT In article <2613@dataio.Data-IO.COM> bright@Data-IO.COM (Walter Bright) writes: >Try this program with your favorite C compiler: > > #include > main() > { char *p; > p = (char *) malloc(10); > free(p); > free(p); > } > >With Zortech, you'll get a "Heap is corrupted" message on the second free. >With some other compilers, you'll get silence, but this does not mean >that the program worked. There should be a clear distinction in your comments as to what the compiler does and what the *run-time library* does. In your example, it's not clear if the compiler catches the second free or if the library routine does. -- Roger Meunier @ Zuken, Inc. Yokohama, Japan (roger@zuken.co.jp)