[libcxx-commits] [libcxx] [libc++] Refactor some code in monotonic_buffer_resource (PR #117271)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 21 19:02:13 PST 2024


================
@@ -27,8 +27,8 @@ namespace pmr {
 // [mem.res.monotonic.buffer]
 
 class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI monotonic_buffer_resource : public memory_resource {
-  static const size_t __default_buffer_capacity  = 1024;
-  static const size_t __default_buffer_alignment = 16;
+  static constexpr size_t __default_buffer_capacity = 1024;
+  static constexpr size_t __default_growth_factor   = 2;
----------------
frederick-vs-ja wrote:

`__default_growth_factor` is not used in headers. I _guess_ it would be better to move it to `memory_resource.cpp`, but I'd ask maintainers first.

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


More information about the libcxx-commits mailing list