buffer intersection check should use > instead of >= (spotted by Arkady)

small optimization -- the segment in bp == firstbuf is always the same
so we just need to compare offsets.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@843 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-04-06 23:03:51 +00:00
parent 83f044fbe0
commit ab21f9be76

View File

@ -481,14 +481,15 @@ void AllocateHMASpace (size_t lowbuffer, size_t highbuffer)
do
{
if (FP_OFF(bp) < highbuffer && FP_OFF(bp+1) >= lowbuffer)
/* check if buffer intersects with requested area */
if (FP_OFF(bp) < highbuffer && FP_OFF(bp+1) > lowbuffer)
{
flush1(bp);
/* unlink bp from buffer chain */
b_prev(bp)->b_next = bp->b_next;
b_next(bp)->b_prev = bp->b_prev;
if (bp == firstbuf)
if (FP_OFF(bp) == FP_OFF(firstbuf))
firstbuf = b_next(bp);
LoL_nbuffers--;
}