Mercurial > vim
diff src/misc2.c @ 3634:286ba0251c0a v7.3.577
updated for version 7.3.577
Problem: Size of memory does not fit in 32 bit unsigned.
Solution: Use Kbyte instead of byte. Call GlobalMemoryStatusEx() instead of
GlobalMemoryStatus() when available.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 29 Jun 2012 15:51:30 +0200 |
parents | cb2ae92ce106 |
children | 99f076ca8d84 |
line wrap: on
line diff
--- a/src/misc2.c +++ b/src/misc2.c @@ -815,6 +815,7 @@ vim_mem_profile_dump() #else # define KEEP_ROOM (2 * 8192L) #endif +#define KEEP_ROOM_KB (KEEP_ROOM / 1024L) /* * Note: if unsigned is 16 bits we can only allocate up to 64K with alloc(). @@ -940,7 +941,7 @@ lalloc(size, message) allocated = 0; # endif /* 3. check for available memory: call mch_avail_mem() */ - if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing) + if (mch_avail_mem(TRUE) < KEEP_ROOM_KB && !releasing) { free((char *)p); /* System is low... no go! */ p = NULL;