0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.4363: MS-Windows: running out of memory for a very long line

Problem:    MS-Windows: running out of memory for a very long line.
Solution:   Use a 32 bit value for MAXCOL also when ints are 64 bits.
This commit is contained in:
Bram Moolenaar
2022-02-12 21:16:21 +00:00
parent 33f3c59854
commit 8e38555ece
2 changed files with 5 additions and 1 deletions

View File

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

View File

@@ -1739,7 +1739,9 @@ typedef unsigned short disptick_T; // display tick type
# define MAXCOL (0x3fffffffL) // maximum column number, 30 bits # define MAXCOL (0x3fffffffL) // maximum column number, 30 bits
# define MAXLNUM (0x3fffffffL) // maximum (invalid) line number # define MAXLNUM (0x3fffffffL) // maximum (invalid) line number
#else #else
# define MAXCOL INT_MAX // maximum column number // MAXCOL used to be INT_MAX, but with 64 bit ints that results in running
// out of memory when trying to allocate a very long line.
# define MAXCOL 0x7fffffffL // maximum column number
# define MAXLNUM LONG_MAX // maximum (invalid) line number # define MAXLNUM LONG_MAX // maximum (invalid) line number
#endif #endif