[libc-commits] [libc] [llvm] [libc][NFC] Remove __support/bit.h and use __support/CPP/bit.h instead (PR #73939)
Guillaume Chatelet via libc-commits
libc-commits at lists.llvm.org
Thu Nov 30 06:01:45 PST 2023
================
@@ -37,17 +38,26 @@ class SafeMemSize {
public:
LIBC_INLINE_VAR static constexpr size_t MAX_MEM_SIZE =
static_cast<size_t>(cpp::numeric_limits<type>::max());
+
LIBC_INLINE explicit SafeMemSize(size_t value)
: value(value <= MAX_MEM_SIZE ? static_cast<type>(value) : -1) {}
+
+ LIBC_INLINE static constexpr size_t offset_to(size_t val, size_t align) {
----------------
gchatelet wrote:
FYI @SchrodingerZhu I moved `offset_to` here as the last function in `__support/bit.h`. Let me know if that works for you. I also moved the test in `memory_size_test.cpp`.
https://github.com/llvm/llvm-project/pull/73939
More information about the libc-commits
mailing list