summaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-08-09 19:59:06 +0200
committerBram Moolenaar <Bram@vim.org>2021-08-09 19:59:06 +0200
commit8ee52affe7fd4daa03e002bc06611f0a8c3bcd5b (patch)
treebf218a0a9a9a0c8c182aca16491f5063f79acce5 /src/alloc.c
parenteed9616120f60ad17d5e133f505bba5c559aee89 (diff)
patch 8.2.3320: some local functions are not staticv8.2.3320
Problem: Some local functions are not static. Solution: Add "static". Move snprintf() related code to strings.c. (Yegappan Lakshmanan, closes #8734)
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 817e322fd4..a2dc08067d 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -232,19 +232,15 @@ lalloc(size_t size, int message)
mem_pre_alloc_l(&size);
#endif
- /*
- * Loop when out of memory: Try to release some memfile blocks and
- * if some blocks are released call malloc again.
- */
+ // Loop when out of memory: Try to release some memfile blocks and
+ // if some blocks are released call malloc again.
for (;;)
{
- /*
- * Handle three kind of systems:
- * 1. No check for available memory: Just return.
- * 2. Slow check for available memory: call mch_avail_mem() after
- * allocating KEEP_ROOM amount of memory.
- * 3. Strict check for available memory: call mch_avail_mem()
- */
+ // Handle three kind of systems:
+ // 1. No check for available memory: Just return.
+ // 2. Slow check for available memory: call mch_avail_mem() after
+ // allocating KEEP_ROOM amount of memory.
+ // 3. Strict check for available memory: call mch_avail_mem()
if ((p = malloc(size)) != NULL)
{
#ifndef HAVE_AVAIL_MEM
@@ -268,10 +264,8 @@ lalloc(size_t size, int message)
goto theend;
#endif
}
- /*
- * Remember that mf_release_all() is being called to avoid an endless
- * loop, because mf_release_all() may call alloc() recursively.
- */
+ // Remember that mf_release_all() is being called to avoid an endless
+ // loop, because mf_release_all() may call alloc() recursively.
if (releasing)
break;
releasing = TRUE;