Enable the static analyser from clang-tidy.
Fix a false positive. The loops in the pagemap accessor are too complicated for the static analyser to check, so it doesn't spot that a non-null return is impossible.
This commit is contained in:
@@ -42,6 +42,15 @@
|
||||
|
||||
#define UNUSED(x) ((void)(x))
|
||||
|
||||
#if __has_builtin(__builtin_assume)
|
||||
# define SNMALLOC_ASSUME(x) __builtin_assume(x)
|
||||
#else
|
||||
# define SNMALLOC_ASSUME(x) \
|
||||
do \
|
||||
{ \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
// #define USE_LZCNT
|
||||
|
||||
#include "address.h"
|
||||
|
||||
@@ -281,6 +281,7 @@ namespace snmalloc
|
||||
|
||||
for (; ix < last; ix++)
|
||||
{
|
||||
SNMALLOC_ASSUME(leaf_ix.first != nullptr);
|
||||
leaf_ix.first->values[ix] = x;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user