[NFC] More checks, comments on end of namespace braces.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
Checks: '-clang-analyzer-security.insecureAPI.bzero,clang-diagnostic-*,google-readability-casting,readability-else-after-return,performance-unnecessary-copy-initialization,bugprone-use-after-move,modernize-use-nullptr,modernize-redundant-void-arg,modernize-return-braced-init-list,modernize-use-default-member-init,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nodiscard,modernize-use-override,cppcoreguidelines-avoid-goto,misc-unconventional-assign-operator,cppcoreguidelines-narrowing-conversions,bugprone-assert-side-effect,bugprone-bool-pointer-implicit-conversion,bugprone-copy-constructor-init,bugprone-forward-declaration-namespace,bugprone-forwarding-reference-overload,bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,bugprone-move-forwarding-reference,bugprone-misplaced-widening-cast,bugprone-swapped-arguments'
|
||||
Checks: '-clang-analyzer-security.insecureAPI.bzero,clang-diagnostic-*,google-readability-casting,readability-else-after-return,performance-unnecessary-copy-initialization,bugprone-use-after-move,modernize-use-nullptr,modernize-redundant-void-arg,modernize-return-braced-init-list,modernize-use-default-member-init,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nodiscard,modernize-use-override,cppcoreguidelines-avoid-goto,misc-unconventional-assign-operator,cppcoreguidelines-narrowing-conversions,bugprone-assert-side-effect,bugprone-bool-pointer-implicit-conversion,bugprone-copy-constructor-init,bugprone-forward-declaration-namespace,bugprone-forwarding-reference-overload,bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,bugprone-move-forwarding-reference,bugprone-misplaced-widening-cast,bugprone-swapped-arguments,bugprone-undelegated-constructor,bugprone-unused-raii,cert-dcl21-cpp,llvm-namespace-comment,misc-static-assert'
|
||||
# It would be nice to enable:
|
||||
# - readability-magic-numbers
|
||||
# - modernize-avoid-c-arrays
|
||||
# - cppcoreguidelines-pro-bounds-array-to-pointer-decay (assert breaks it).
|
||||
# - readability-braces-around-statements (mostly works, but is very confused by constexpr if).
|
||||
CheckOptions:
|
||||
- key: modernize-use-default-member-init.UseAssignment
|
||||
value: '1'
|
||||
|
||||
@@ -110,4 +110,4 @@ namespace snmalloc
|
||||
#endif
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -39,4 +39,4 @@ namespace snmalloc
|
||||
{
|
||||
return reinterpret_cast<T*>(address);
|
||||
}
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -491,5 +491,5 @@ namespace snmalloc
|
||||
{
|
||||
return t1 > t2 ? t1 : t2;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace bits
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -52,4 +52,4 @@ namespace snmalloc
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
@@ -169,4 +169,4 @@ namespace snmalloc
|
||||
#endif
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -21,4 +21,4 @@ namespace snmalloc
|
||||
lock.clear(std::memory_order_release);
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -77,4 +77,4 @@ namespace snmalloc
|
||||
return array[i & (rlength - 1)];
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -72,4 +72,4 @@ namespace snmalloc
|
||||
return top;
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -79,4 +79,4 @@ namespace snmalloc
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -1250,4 +1250,4 @@ namespace snmalloc
|
||||
return page_map;
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -143,4 +143,4 @@ namespace snmalloc
|
||||
"SLAB_COUNT must be a power of 2");
|
||||
static_assert(
|
||||
SLAB_COUNT <= (UINT8_MAX + 1), "SLAB_COUNT must fit in a uint8_t");
|
||||
};
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -16,4 +16,4 @@ namespace snmalloc
|
||||
return allocator;
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -389,4 +389,4 @@ namespace snmalloc
|
||||
}
|
||||
#endif
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -29,4 +29,4 @@ namespace snmalloc
|
||||
return kind;
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -176,4 +176,4 @@ namespace snmalloc
|
||||
}
|
||||
|
||||
using Alloc = Allocator<GlobalVirtual>;
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -410,4 +410,4 @@ namespace snmalloc
|
||||
* passed as an argument.
|
||||
*/
|
||||
HEADER_GLOBAL GlobalVirtual default_memory_provider;
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -129,4 +129,4 @@ namespace snmalloc
|
||||
((address_cast(p) - address_cast(this))) >> 8);
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -170,4 +170,4 @@ namespace snmalloc
|
||||
#endif
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -357,4 +357,4 @@ namespace snmalloc
|
||||
} while (length > 0);
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -95,4 +95,4 @@ namespace snmalloc
|
||||
return p->list_next;
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace snmalloc
|
||||
/// Used by the pool to keep the list of all entries ever created.
|
||||
T* list_next;
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
@@ -47,4 +47,4 @@ namespace snmalloc
|
||||
reinterpret_cast<uintptr_t>(&message_queue));
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -167,4 +167,4 @@ namespace snmalloc
|
||||
return relative;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -92,4 +92,4 @@ namespace snmalloc
|
||||
return sizeclass_metadata
|
||||
.medium_slab_slots[(sizeclass - NUM_SMALL_CLASSES)];
|
||||
}
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -163,4 +163,4 @@ namespace snmalloc
|
||||
return (address_cast(this) & SUPERSLAB_MASK) == address_cast(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -65,4 +65,4 @@ namespace snmalloc
|
||||
{
|
||||
return SlowAllocator{};
|
||||
}
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -242,4 +242,4 @@ namespace snmalloc
|
||||
return NoStatusChange;
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -266,4 +266,4 @@ namespace snmalloc
|
||||
#else
|
||||
using ThreadAlloc = ThreadAllocExplicitTLSCleanup;
|
||||
#endif
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
namespace snmalloc
|
||||
{
|
||||
void error(const char* const str);
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
// If simultating OE, then we need the underlying platform
|
||||
#if !defined(OPEN_ENCLAVE) || defined(OPEN_ENCLAVE_SIMULATION)
|
||||
@@ -50,4 +50,4 @@ namespace snmalloc
|
||||
{
|
||||
Pal::error(str);
|
||||
}
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -42,4 +42,4 @@ namespace snmalloc
|
||||
*/
|
||||
YesZero
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
@@ -91,5 +91,5 @@ namespace snmalloc
|
||||
return p;
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
#endif
|
||||
|
||||
@@ -29,4 +29,4 @@ namespace snmalloc
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace snmalloc
|
||||
|
||||
Reference in New Issue
Block a user