delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/26/09:22:58

Date: Tue, 26 Sep 2000 15:21:07 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Rafał Maj <r_maj AT poczta DOT onet DOT pl>
cc: djgpp AT delorie DOT com
Subject: Re: Re-start program ?
In-Reply-To: <8q3d8e$ria$1@info.cyf-kr.edu.pl>
Message-ID: <Pine.SUN.3.91.1000926151555.13268K-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 17 Sep 2000, Rafa=B3 Maj wrote:

> I think, that the best way to defragment all memory, and make all memory
> again available (in case of any memory leeks) is to... exit program & run=
 it
> again :)
>=20
> But how to do it ?

You can't.  DJGPP doesn't support this mode of program restart.

> If I'll realy to quit program, then main program will write some informat=
ion
> to disk file, to tell caller-program to quit.

To make this work in a real-life application, you will have to save=20
memory contents and file handles that existed in the program before you=20
exited, and then restore those when the program is restarted.  There's no=
=20
library function which does that, so unless you do all this in your own=20
code (lots of it ;-), it won't work.

It's much easier to find all those memory leaks and correct them.  And=20
you get a better program as a bonus ;-)

> >>>>>> Ther are so many spawn*** functions... Witch to call, how to call =
it,
> when main program name is "main.exe" and arguments are "1st" and "2nd" ?

As far as I could see, the Info page for the "spawn*" functions includes=20
an example.

- Raw text -


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