comparison src/alloc.c @ 25567:0082503ff2ff v8.2.3320

patch 8.2.3320: some local functions are not static Commit: https://github.com/vim/vim/commit/8ee52affe7fd4daa03e002bc06611f0a8c3bcd5b Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Aug 9 19:59:06 2021 +0200 patch 8.2.3320: some local functions are not static Problem: Some local functions are not static. Solution: Add "static". Move snprintf() related code to strings.c. (Yegappan Lakshmanan, closes #8734)
author Bram Moolenaar <Bram@vim.org>
date Mon, 09 Aug 2021 20:00:06 +0200
parents bb1097899693
children 13e09dc59f0f
comparison
equal deleted inserted replaced
25566:e1c7aa26ddf5 25567:0082503ff2ff
230 230
231 #ifdef MEM_PROFILE 231 #ifdef MEM_PROFILE
232 mem_pre_alloc_l(&size); 232 mem_pre_alloc_l(&size);
233 #endif 233 #endif
234 234
235 /* 235 // Loop when out of memory: Try to release some memfile blocks and
236 * Loop when out of memory: Try to release some memfile blocks and 236 // if some blocks are released call malloc again.
237 * if some blocks are released call malloc again.
238 */
239 for (;;) 237 for (;;)
240 { 238 {
241 /* 239 // Handle three kind of systems:
242 * Handle three kind of systems: 240 // 1. No check for available memory: Just return.
243 * 1. No check for available memory: Just return. 241 // 2. Slow check for available memory: call mch_avail_mem() after
244 * 2. Slow check for available memory: call mch_avail_mem() after 242 // allocating KEEP_ROOM amount of memory.
245 * allocating KEEP_ROOM amount of memory. 243 // 3. Strict check for available memory: call mch_avail_mem()
246 * 3. Strict check for available memory: call mch_avail_mem()
247 */
248 if ((p = malloc(size)) != NULL) 244 if ((p = malloc(size)) != NULL)
249 { 245 {
250 #ifndef HAVE_AVAIL_MEM 246 #ifndef HAVE_AVAIL_MEM
251 // 1. No check for available memory: Just return. 247 // 1. No check for available memory: Just return.
252 goto theend; 248 goto theend;
266 } 262 }
267 else 263 else
268 goto theend; 264 goto theend;
269 #endif 265 #endif
270 } 266 }
271 /* 267 // Remember that mf_release_all() is being called to avoid an endless
272 * Remember that mf_release_all() is being called to avoid an endless 268 // loop, because mf_release_all() may call alloc() recursively.
273 * loop, because mf_release_all() may call alloc() recursively.
274 */
275 if (releasing) 269 if (releasing)
276 break; 270 break;
277 releasing = TRUE; 271 releasing = TRUE;
278 272
279 clear_sb_text(TRUE); // free any scrollback text 273 clear_sb_text(TRUE); // free any scrollback text