From: Glen Miner 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: NNTP-Posting-Host: 138.120.136.238 Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: DJ Delorie 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