aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas Hillegeer <nicolas@hillegeer.com>2014-03-29 17:44:09 +0100
committerNicolas Hillegeer <nicolas@hillegeer.com>2014-03-29 20:10:06 +0100
commit28b3659955d154d04ac8e531b54f1ec32f3136a7 (patch)
tree50f73566bcafd5486db35454845b58213fd4f3d9 /src
parentd5708b200a3ea978cbad824c15fa18607d23790a (diff)
downloadrneovim-28b3659955d154d04ac8e531b54f1ec32f3136a7.tar.gz
rneovim-28b3659955d154d04ac8e531b54f1ec32f3136a7.tar.bz2
rneovim-28b3659955d154d04ac8e531b54f1ec32f3136a7.zip
use function attributes on allocation functions
This should allow gcc/clang/icc to generate better code and clarifies function intent.
Diffstat (limited to 'src')
-rw-r--r--src/misc2.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/misc2.h b/src/misc2.h
index 09b608de43..d8f13d7640 100644
--- a/src/misc2.h
+++ b/src/misc2.h
@@ -1,5 +1,8 @@
#ifndef NEOVIM_MISC2_H
#define NEOVIM_MISC2_H
+
+#include "func_attr.h"
+
/* misc2.c */
int virtual_active(void);
int getviscol(void);
@@ -20,11 +23,11 @@ void check_cursor_col_win(win_T *win);
void check_cursor(void);
void adjust_cursor_col(void);
int leftcol_changed(void);
-char_u *alloc(unsigned size);
-char_u *alloc_clear(unsigned size);
-char_u *alloc_check(unsigned size);
-char_u *lalloc_clear(long_u size, int message);
-char_u *lalloc(long_u size, int message);
+char_u *alloc(unsigned size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1);
+char_u *alloc_clear(unsigned size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1);
+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);
+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);
char_u *vim_strsave(char_u *string);