[libcxx-commits] [libcxx] Lower std::string's alignment requirement from 16 to 8. (PR #68807)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 11 11:40:04 PDT 2023
================
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// This test demonstrates the smaller allocation sizes when the alignment
+// requirements of std::string are dropped from 16 to 8.
+#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <string>
+
+#include "test_macros.h"
+
+// alignment of the string heap buffer is hardcoded to 16
----------------
EricWF wrote:
Done.
https://github.com/llvm/llvm-project/pull/68807
More information about the libcxx-commits
mailing list