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

@@ -1739,7 +1739,9 @@ typedef unsigned short disptick_T; // display tick type
# define MAXCOL (0x3fffffffL) // maximum column number, 30 bits
# define MAXLNUM (0x3fffffffL) // maximum (invalid) line number
#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
#endif