www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/02/19/11:29:56

From: kroe AT sbcs DOT sunysb DOT edu (KiYun Roe)
Date: Wed, 19 Feb 92 11:07:27 EST
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Bug in valloc.c, spawno
Status: O

It seems to me that a similar bug exists in the XMS calculations.  In
xms_alloc_init,

        pn_hi_first = (linear_base + 4095)/4096;
	pn_hi_last = pn_hi_first + emb_size / 4 - 1;

should be

        pn_hi_first = (linear_base + 4095)/4096;
        pn_hi_last = (linear_base + emb_size * 1024L)/4096 - 1;

Computing pn_hi_last from a base of pn_hi_first is wrong because it
effectively assumes up to 4095 more bytes are available.  Consider when
linear_base == 1 and emb_size == 4 -- there are no valid pages!  It may
be that XMS managers put things on 4k boundaries anyway, so we haven't
experienced problems with this, but the calculations don't need to
assume that.

- Raw text -


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