[libcxx-commits] [PATCH] D154017: Cleanup __uninitialized_temporary_buffer internals.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 28 23:15:14 PDT 2023


Mordante added a comment.

Thanks for working on this. In general looks good, I like to see a green CI.



================
Comment at: libcxx/include/__memory/uninitialized_buffer.h:38
+  _LIBCPP_HIDE_FROM_ABI void operator()(_Tp* __ptr) const _NOEXCEPT {
+    std::__libcpp_deallocate(__ptr, __count_ * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
   }
----------------
pre-existing nit: `sizeof(_Tp) * __count_` seems more natural and matches line 48.


================
Comment at: libcxx/include/new:297
 
+inline _LIBCPP_INLINE_VISIBILITY
+void *__libcpp_allocate(size_t __size, size_t __align, nothrow_t) {
----------------
s/_LIBCPP_INLINE_VISIBILITY/_LIBCPP_HIDE_FROM_ABI/


================
Comment at: libcxx/include/new:300
+#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+  if (__is_overaligned_for_new(__align)) {
+    const align_val_t __align_val = static_cast<align_val_t>(__align);
----------------
Mainly curious, but would it make sense to have this check in the Clang builtin?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154017/new/

https://reviews.llvm.org/D154017



More information about the libcxx-commits mailing list