mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
Replace alloc_check
by xmalloc
`alloc_check` is just a wrapper around xmalloc, so we can remove it and use xmalloc directly. ref #487 / #488 The call was replaced in the following files: - ex_cmds.c - misc1.c - ops.c
This commit is contained in:

committed by
Thiago de Arruda

parent
321c67d610
commit
3fcdb2ab29
16
src/memory.c
16
src/memory.c
@@ -72,22 +72,6 @@ char_u *alloc_clear(unsigned size)
|
||||
return (char_u *)xcalloc(1, (size_t)size);
|
||||
}
|
||||
|
||||
/*
|
||||
* alloc() with check for maximum line length
|
||||
*/
|
||||
char_u *alloc_check(unsigned size)
|
||||
{
|
||||
#if !defined(UNIX) && !defined(__EMX__)
|
||||
if (sizeof(int) == 2 && size > 0x7fff) {
|
||||
/* Don't hide this message */
|
||||
emsg_silent = 0;
|
||||
EMSG(_("E340: Line is becoming too long"));
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
return lalloc((long_u)size, TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate memory like lalloc() and set all bytes to zero.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user