Date: Wed, 29 Dec 1999 10:12:46 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Chaos cc: djgpp AT delorie DOT com Subject: Re: freeing memory and exiting (safely) In-Reply-To: <848onr$rvo$3@portraits.wsisiz.edu.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 26 Dec 1999, Chaos wrote: > >Just terminate with 'exit(1);', and that's it. > > Hmm. I read that exit(X) DOES NOT do anything to memory. In info (as well as > in Borland 3.1 help) there is that exit() sends exit code to OS, closes any > stream and finaly terminates program. And what about memory? All the memory is deallocated, and the related selectors freed, as part of the DJGPP exit code. See the file src/libc/crt0/crt0.S in the library sources, for the gory details.