diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-02-12 21:16:21 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-12 21:16:21 +0000 |
commit | 8e38555ece7d3fe1edc6681ec70fe5586a524862 (patch) | |
tree | 4b6f5af33a3ac745e2457c625e682a7dc966181b | |
parent | 33f3c5985491032d5bdfc30e722e85d5a0285e64 (diff) |
patch 8.2.4363: MS-Windows: running out of memory for a very long linev8.2.4363
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.
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim.h | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/version.c b/src/version.c index 1fc176779d..18f7892f18 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4363, +/**/ 4362, /**/ 4361, @@ -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 |