0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.1b-002

This commit is contained in:
Bram Moolenaar 2007-05-11 18:15:45 +00:00
parent 060f1f08b3
commit fe265ff56f
2 changed files with 21 additions and 1 deletions

View File

@ -190,7 +190,25 @@ mf_open(fname, flags)
mfp->mf_blocknr_min = -1;
mfp->mf_neg_count = 0;
mfp->mf_infile_count = mfp->mf_blocknr_max;
mfp->mf_used_count_max = p_mm * 1024 / mfp->mf_page_size;
/*
* Compute maximum number of pages ('maxmem' is in Kbyte):
* 'mammem' * 1Kbyte / page-size-in-bytes.
* Avoid overflow by first reducing page size as much as possible.
*/
{
int shift = 10;
unsigned page_size = mfp->mf_page_size;
while (shift > 0 && (page_size & 1) == 0)
{
page_size = page_size >> 1;
--shift;
}
mfp->mf_used_count_max = (p_mm << shift) / page_size;
if (mfp->mf_used_count_max < 10)
mfp->mf_used_count_max = 10;
}
return mfp;
}

View File

@ -666,6 +666,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2,
/**/
1,
/**/