home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pascal / 6835 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  1.4 KB

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