[libcxx-commits] [libcxx] [libcxx] Configuration option to lower deque block size (PR #198348)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 3 01:27:22 PDT 2026


================
@@ -265,7 +265,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _ValueType, class _DiffType>
 struct __deque_block_size {
-  static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16;
+  static const _DiffType value =
+      (sizeof(_ValueType) * _LIBCPP_DEQUE_MIN_ELEMENTS_PER_BLOCK < _LIBCPP_DEQUE_TARGET_BLOCK_SIZE)
+          ? (_LIBCPP_DEQUE_TARGET_BLOCK_SIZE / sizeof(_ValueType))
+          : _LIBCPP_DEQUE_MIN_ELEMENTS_PER_BLOCK;
----------------
philnik777 wrote:

I think I'd rather just have two definitions of this. All the macros make is quite hard to read.

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


More information about the libcxx-commits mailing list