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

@@ -47,11 +47,11 @@ public:
* to signal "error". An empty destination buffer is not
* always an error.
*/
gcc_malloc
gcc_malloc gcc_returns_nonnull
void *Get(size_t size);
template<typename T>
gcc_malloc
gcc_malloc gcc_returns_nonnull
T *GetT(size_t n) {
return (T *)Get(n * sizeof(T));
}

View File

@@ -122,7 +122,7 @@ sample_format_size(SampleFormat format)
* @param format a #SampleFormat enum value
* @return the string
*/
gcc_pure gcc_malloc
gcc_pure gcc_malloc gcc_returns_nonnull
const char *
sample_format_to_string(SampleFormat format) noexcept;