[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 26 14:23:53 PDT 2024


vitalybuka wrote:

Delete uses __get_long_cap()

```
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __set_long_cap(size_type __s) _NOEXCEPT {
    __r_.first().__l.__cap_     = __s / __endian_factor;
    __r_.first().__l.__is_long_ = true;
  }

  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __get_long_cap() const _NOEXCEPT {
    return __r_.first().__l.__cap_ * __endian_factor;
  }
```

And if __set_long_cap() provided with odd number, and __endian_factor == 2, __get_long_cap() will be short by 1.

https://github.com/llvm/llvm-project/pull/83774


More information about the cfe-commits mailing list