comparison src/vim.h @ 27675:30cb026ec968 v8.2.4363

patch 8.2.4363: MS-Windows: running out of memory for a very long line Commit: https://github.com/vim/vim/commit/8e38555ece7d3fe1edc6681ec70fe5586a524862 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 12 21:16:21 2022 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Feb 2022 22:30:02 +0100
parents b157387cb232
children 2a2c0958a913
comparison
equal deleted inserted replaced
27674:e0e00e365288 27675:30cb026ec968
1737 */ 1737 */
1738 #ifdef __MVS__ 1738 #ifdef __MVS__
1739 # define MAXCOL (0x3fffffffL) // maximum column number, 30 bits 1739 # define MAXCOL (0x3fffffffL) // maximum column number, 30 bits
1740 # define MAXLNUM (0x3fffffffL) // maximum (invalid) line number 1740 # define MAXLNUM (0x3fffffffL) // maximum (invalid) line number
1741 #else 1741 #else
1742 # define MAXCOL INT_MAX // maximum column number 1742 // MAXCOL used to be INT_MAX, but with 64 bit ints that results in running
1743 // out of memory when trying to allocate a very long line.
1744 # define MAXCOL 0x7fffffffL // maximum column number
1743 # define MAXLNUM LONG_MAX // maximum (invalid) line number 1745 # define MAXLNUM LONG_MAX // maximum (invalid) line number
1744 #endif 1746 #endif
1745 1747
1746 #define SHOWCMD_COLS 10 // columns needed by shown command 1748 #define SHOWCMD_COLS 10 // columns needed by shown command
1747 1749