Compiler.h: add gcc_returns_nonnull, gcc_returns_twice

This commit is contained in:
Max Kellermann
2017-12-18 23:00:13 +01:00
parent 5582367d68
commit edee8a3446
12 changed files with 27 additions and 23 deletions

View File

@@ -84,7 +84,7 @@ public:
* Get the buffer, and guarantee a minimum size. This buffer
* becomes invalid with the next Get() call.
*/
gcc_malloc
gcc_malloc gcc_returns_nonnull
T *Get(size_t size) {
if (gcc_unlikely(size > capacity)) {
/* too small: grow */