[libcxx] [llvm] [libc++] Make std::align an inline function (PR #167472)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 17 20:21:09 PST 2025


================
@@ -11,15 +11,37 @@
 
 #include <__config>
 #include <__cstddef/size_t.h>
+#include <cstdint>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+#if defined(_LIBCPP_DISABLE_INLINE_OPTIMIZE_BECAUSE_MULTIPLY_SYMBOLS_ERROR) && !defined(_LIBCPP_ABI_DO_NOT_EXPORT_ALIGN)
+
 _LIBCPP_EXPORTED_FROM_ABI void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
 
+#else
+
+_LIBCPP_HIDE_FROM_ABI inline void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space) {
----------------
poor-circle wrote:

Inline namespace is a good idea.

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


More information about the llvm-commits mailing list