home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!caen!batcomputer!ghost.dsi.unimi.it!univ-lyon1.fr!cismibm.ibm.univ-lyon1.fr!ppollet
- From: ppollet@cismibm.ibm.univ-lyon1.fr (Patrick POLLET)
- Newsgroups: comp.lang.pascal
- Subject: Re: TP's heap
- Date: Mon, 23 Nov 1992 15:10:05 GMT
- Organization: INSA
- Lines: 31
- Message-ID: <ppollet.2.722531405@cismibm.ibm.univ-lyon1.fr>
- References: <2950.2B09361C@catpe.alt.za>
- NNTP-Posting-Host: 134.214.232.25
-
- In article <2950.2B09361C@catpe.alt.za> louis@p2.f42.n7101.z5.fidonet.org (Louis Mandelstam) writes:
- >From: louis@p2.f42.n7101.z5.fidonet.org (Louis Mandelstam)
- >Subject: TP's heap
- >Date: 16 Nov 92 15:37:01 GMT
-
- >Anyone have a simple way to deallocate TP's heap and then allocate it again?
-
- >My project needs a large heap but I also need to run COMMAND.COM from the
- >program. The data in the heap can be lost during the execution, it'll be
- >saved before and reloaded afterwards.
-
- >Cheers
- >The Poltergeist
-
- >--
- >INTERNET: louis@catpe.alt.za - Louis Mandelstam.
- >PO Box 4574, Randburg, 2125. South Africa.
- >"Even if *had* an employer, this would probably not be his opinion."
-
- The following piece of code should do the Trick in TP6
- (cf TVDEMO.PAS demo file in TP6\TVDEMOS directory )
- Uses Memory; (* for setmemtop*)
-
- DoneMemory;
- SetMemTop(HeapPtr);
- SwapVectors;
- Exec(GetEnv('COMSPEC'),'/C '+ the name of the EXE,COm or BAT file to
- run);
- SwapVectors;
- SetMemTop(HeapEnd);
- Initmemory;
-