Hi,

In lalloc function, when allocating memory, mch_avail_mem is called
for getting the free memory size.
This function is prone with overflow. At least I'm pretty sure that I
have been getting random
memory allocation error from vim because this function sometimes
overflows in windows.

Wouldn't it be possible to replace it with malloc-ing a temporary
memory. For example

if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)

become

void *temp = malloc(KEEP_ROOM);
if (!temp && !releasing)
{
    // do something to release memory
}
else
{
    free(temp);
}

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui