aboutsummaryrefslogtreecommitdiff
path: root/src/misc2.h
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-03-29 01:05:04 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-03-31 07:31:47 -0300
commit0e998066b2533de3cf87ece1068839e60e128f1a (patch)
tree0dc09cd25ef39a59e6f9c1c41493e11bacea8f79 /src/misc2.h
parent7bdd1f1898c6c94326e4642d8f51f74cc14b5f9d (diff)
downloadrneovim-0e998066b2533de3cf87ece1068839e60e128f1a.tar.gz
rneovim-0e998066b2533de3cf87ece1068839e60e128f1a.tar.bz2
rneovim-0e998066b2533de3cf87ece1068839e60e128f1a.zip
xrealloc(): similar to xmalloc()
Replaced all calls to realloc by xrealloc. All `== NULL` tests can be removed and the code within `!= NULL` tests can be unwrapped.
Diffstat (limited to 'src/misc2.h')
-rw-r--r--src/misc2.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/misc2.h b/src/misc2.h
index 0e52993412..ddf71b3ac1 100644
--- a/src/misc2.h
+++ b/src/misc2.h
@@ -29,6 +29,8 @@ char_u *alloc_check(unsigned size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1);
char_u *lalloc_clear(long_u size, int message) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1);
void try_to_free_memory();
void *xmalloc(size_t size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1);
+void *xrealloc(void *ptr, size_t size)
+ FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_ALLOC_SIZE(2);
char_u *lalloc(long_u size, int message) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1);
void do_outofmem_msg(long_u size);
void free_all_mem(void);