🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.msdos.programmer
3 messages
3 total messages Started by Bruce Atherton Wed, 25 Jul 1990 16:34
Virtual Memory for the Heap
#1683
Author: Bruce Atherton
Date: Wed, 25 Jul 1990 16:34
24 lines
1521 bytes
I'm looking for the best method of implementing virtual memory on 80x86
machines under MSDOS.  Specifically, it has to allow swapping of the
heap, rather than code.  The method that is the simplest to implement
and least buggy would be preferable.

I just received Turbo C++ and was thinking of using VROOMM, but it
appears to only swap overlays of code.  Is there any way to allow it to
swap from the heap?  Do I have to overload the -> operator so that it
works with pages, or can VROOMM take care of that for me (and if so,
how?).

What about using _handle in Zortech C++?  It sounds like it would be
easy for bugs to creep in, from the description I read.  I would also
like to hear about any heap manager toolboxes and how they work.

Finally, is there a speed advantage to any of these methods over using a
disk caching system?

I would be grateful for any information on these questions.


Bruce_Atherton@mindlink.UUCP or| "Lotta people think the spikes on forts was
uunet!van-bc!rsoft!mindlink!a35| to protect 'gainst injuns, but that's stupid.
                                 Injuns knew about doors.  But clams didn't."
Re: Virtual Memory for the Heap
#1688
Author: Jihad 'R US
Date: Fri, 27 Jul 1990 10:39
43 lines
2665 bytes
In article <2628@mindlink.UUCP> a35@mindlink.UUCP (Bruce Atherton) writes:


   I'm looking for the best method of implementing virtual memory on 80x86
   machines under MSDOS.  Specifically, it has to allow swapping of the
   heap, rather than code.  The method that is the simplest to implement
   and least buggy would be preferable.

   I just received Turbo C++ and was thinking of using VROOMM, but it
   appears to only swap overlays of code.  Is there any way to allow it to
   swap from the heap?  Do I have to overload the -> operator so that it
   works with pages, or can VROOMM take care of that for me (and if so,
   how?).

VROOM will not swap data.  The main problem with swapping data is that 
it is accessed 'asyncronously'. i.e.  You never know when you will need
to be in, since pointers can point anywhere.  Code is always accesed
with calls, and can be routed through a overlay maneger. ( setjmp,
longjmp could cause problems . . .)   One way of dealing with this is to
only use access to memory through 'handles' ( picked the idea up from
_mac_ programing.) and have a byte that says if the info is in main
memory ( in which case you use the pointer in the handle structure) or
not, in which case you use the (ems|xms|ext|disk) handle you have setup
to load the handle into main memory( and load out any needed to make
space). You could even put a byte in for 'locking' the pointer so it
does not get swapped out. 

   What about using _handle in Zortech C++?  It sounds like it would be
   easy for bugs to creep in, from the description I read.  I would also
   like to hear about any heap manager toolboxes and how they work.

   Finally, is there a speed advantage to any of these methods over using a
   disk caching system?

Yes:  disk caching doesn't do diddly for speeding up writing data.
Not so important with code( how often do you write self modifing code)
very important with data.

  I would be grateful for any information on these questions.
happy to reply.

Rob Blair 6600m00n@ucsbuxa.ucsb.edu
'Yea, brother . . .'
Re: Virtual Memory for the Heap
#1697
Author: Walter Bright
Date: Fri, 27 Jul 1990 21:22
21 lines
1474 bytes
In article <2628@mindlink.UUCP> a35@mindlink.UUCP (Bruce Atherton) writes:
<I'm looking for the best method of implementing virtual memory on 80x86
<machines under MSDOS.  Specifically, it has to allow swapping of the
<heap, rather than code.  The method that is the simplest to implement
<and least buggy would be preferable.
<
<What about using _handle in Zortech C++?  It sounds like it would be
<easy for bugs to creep in, from the description I read.

I've used _handles quite a bit in my code. The reason they were implemented
is that the code looked so *ugly* when explicit function calls had to be
done to dereference a handle. Thus, making a handle a special pointer type,
and having the compiler call the function for you, cleaned up the code
a lot. I'd say that the _handles are certainly the easiest to convert your
code into using.

The thing to watch out for is inadvertently converting a handle to a far
pointer, as in stuff like:
	char _handle *h;
	h = (char *) handle_malloc(10);		/* error!	*/
	h = (char _handle *) handle_malloc(10);	/* correct way	*/
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads