Introduce two gcc attributes (also recognized by clang) to
warn_unused_result obviously good for checking the code is correct.
alloc_size GCC uses this information to improve the
correctness of __builtin_object_size.
Both are supported by modern clang.
The specific attributes were inspired by bionic's libc (which uses
This should have some performance positive impact but it is very
difficult to quantify and should also help the static checker.
A proof of concept patch to add the same flags to jemalloc's build
has been submitted upstream and is likely to be accepted.