home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!cs.utexas.edu!torn!news.ccs.queensu.ca!mast.queensu.ca!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Subject: Re: Expanded memory and the heap...
- Message-ID: <dmurdoch.35.714057983@mast.queensu.ca>
- Lines: 40
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- References: <1992Aug15.163435.25855@iitmax.iit.edu>
- Date: Mon, 17 Aug 1992 13:26:23 GMT
-
- In article <1992Aug15.163435.25855@iitmax.iit.edu> bruifal@elof.iit.edu (Falke Bruinsma) writes:
- >
- >I am writing a program that needs huge amounts of memory, at this moment
- >around 700K. Basically it is one huge tree and I add new records to it
- >by the following command NEW(ptr); However around the 600K (you guessed it)
- >I get a heap overflow... Since I do have expanded memory I as wondering if
- >someone can help me write a unit that makes the expanded memory an extension
- >of the heap. So that the program accesses expanded memory whenever the heap
- >is full.
-
- It's not too difficult to put the EMS page frame into the heap, if 64K more
- memory would be enough; Compuserve has a program that does this, and also
- any other "high" memory that it can find. That's usually not much more than
- 100K though.
-
- If you really want full access to your EMS, you need some sort of paging
- scheme. I saw an ad once that a German company called OKSoft (sp?) had a
- package that patched itself into the TP compiler and made this automatic,
- but I've never heard anything more about that in the last year or so.
-
- If you want to write it yourself, it's probably not practical to make the
- paging transparent. The best approach is probably to use "handles"; instead
- of pointing to the thing you've allocated, they point to a record saying
- where to find it. You write procedures to dereference a handle by checking
- the record and loading the thing if necessary. It gets complicated if you
- want to be able to dereference several handles at once, because they might
- not all fit in memory at the same time.
-
- A simpler approach which might well be good enough, is to keep your data on
- a stream. Use Seek, Read and Write every time you want to access or change
- it. Then you can have as much data as you have disk space, and if you've
- got enough EMS to hold the whole dataset, you can load it into an EMS stream
- and get the speed boost. I've been using this method lately, and living
- with the relatively slow access. I use a TempStream from my Streams
- unit; that automatically chooses between RAM, EMS, XMS and disk,
- according to priorities you set. Streams is available as garbo.uwasa.fi:/pc/
- turbovis/stream13.zip by ftp.
-
- Duncan Murdoch
- dmurdoch@mast.queensu.ca
-