delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/28/16:51:41

From: "Chaos" <chengin AT alpha DOT net DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: freeing memory and exiting (safely)
Date: Sun, 26 Dec 1999 15:39:23 +0100
Organization: Chaos Engine
Lines: 32
Message-ID: <848onr$rvo$3@portraits.wsisiz.edu.pl>
References: <83ril4$4ua$1 AT portraits DOT wsisiz DOT edu DOT pl> <83t969$ras AT acp3bf DOT knirsch DOT de>
NNTP-Posting-Host: pe191.warszawa.ppp.tpnet.pl
X-Trace: portraits.wsisiz.edu.pl 946333243 28664 212.160.56.191 (27 Dec 1999 22:20:43 GMT)
X-Complaints-To: abuse AT news DOT wsisiz DOT edu DOT pl
NNTP-Posting-Date: 27 Dec 1999 22:20:43 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.1
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

>> My question is that if the prog reaches that "return 1" (synonim for
error)
>> does those buffers will be safely deallocated?
>
>Yes. If not, it's a bug in your operating system, and there's nothing
>you can do about _that_ (other than using a better OS).
>
>> just want to exit safe from the program and deallocate it's memory
without
>> blocking it in later use.
>
>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? That's where my
doubts was coming from.

But since OS is worring about safelly destroy my allocated memory I can
sleep safely ;-)
Thnx for answering.
>
>--
>Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
>Even if all the snow were burnt, ashes would remain.

Take care.
-=| Chaos |=-
e-mail:  chengin AT alpha DOT net DOT pl
              chengin AT polbox DOT com


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019