www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/15/19:13:27

From: Glen Miner <gminer AT ca DOT newbridge DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Memory Protection
Date: Fri, 15 Nov 1996 12:25:31 -0500 (EST)
Organization: Newbridge Networks Corporation
Lines: 26
Message-ID: <Pine.SUN.3.90.961115121752.21366A-100000@coop10>
NNTP-Posting-Host: 138.120.136.238
Mime-Version: 1.0
To: DJ Delorie <dj AT delorie DOT com>
In-Reply-To: <199611151720.MAA20713@delorie.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> > > > If I disable memory protection, will my program run faster?
> > > 
> > > No.
> > 
> > Really? I find this hard to believe. How does it detect memory 
> > violations? I would tend to think that it doesn't managed to determine 
> > this for "free", and would have to waste cycles in order to detect it.
> 
> Memory protection is handled by checking to make sure your accesses
> are within the segment boundaries.  When you "disable" protection in
> djgpp, all you are really doing is resizing the segments to cover all
> 4Gb of your virtual address space, so it is impossible to be outside
> the segment.  The CPU chip still does the computations required, but
> these rarely impact execution times - they're done in hardware.

Ahh, this makes sense now. I suppose my next question is: how does the
dosmem put/get  functions get around this? Do they resize before and 
after? Wouldn't this be painfully inneffeicient?

Peace
===[ Gabo / [ABC] : gaminer AT undergrad DOT math DOT uwaterloo DOT ca ]===================
Latest ABC Shogi: http://www.undergrad.math.uwaterloo.ca/~gaminer/shogi.html
"What Greenpeace spends in a year General Motors spends in four hours" -Moby


- Raw text -


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