This is an automated email from the ASF dual-hosted git repository.

airborne12 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 53132a19a96 [fix](be) Fix macOS BE build (#63230)
53132a19a96 is described below

commit 53132a19a96042b08ccd751a63e550012d7a2b8a
Author: Jack <[email protected]>
AuthorDate: Tue May 19 10:09:05 2026 +0800

    [fix](be) Fix macOS BE build (#63230)
    
    ### What problem does this PR solve?
    
    Issue Number: None
    
    Related PR: None
    
    Problem Summary:
    
    Fix BE compilation failures on macOS libc++ while keeping the Linux path
    on the original `std::atomic<std::shared_ptr<...>>` implementation.
    `MultiVersion` now uses the existing Doris `atomic_shared_ptr` fallback
    only when `USE_LIBCPP` is enabled, and `MemLimiter` avoids mixed
    `long`/`int64_t` template deduction in `std::max`.
---
 be/src/common/multi_version.h | 8 ++++++++
 be/src/exec/common/memory.cpp | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/be/src/common/multi_version.h b/be/src/common/multi_version.h
index 441f8dedae3..6077d74157d 100644
--- a/be/src/common/multi_version.h
+++ b/be/src/common/multi_version.h
@@ -23,6 +23,10 @@
 #include <atomic>
 #include <memory>
 
+#ifdef USE_LIBCPP
+#include "common/atomic_shared_ptr.h"
+#endif
+
 /** Allow to store and read-only usage of an object in several threads,
   *  and to atomically replace an object in another thread.
   * The replacement is atomic and reading threads can work with different 
versions of an object.
@@ -59,5 +63,9 @@ public:
     }
 
 private:
+#ifdef USE_LIBCPP
+    doris::atomic_shared_ptr<const T> current_version;
+#else
     std::atomic<Version> current_version;
+#endif
 };
diff --git a/be/src/exec/common/memory.cpp b/be/src/exec/common/memory.cpp
index 4ca4af037b3..09114daf2d7 100644
--- a/be/src/exec/common/memory.cpp
+++ b/be/src/exec/common/memory.cpp
@@ -51,7 +51,7 @@ int MemLimiter::available_scanner_count(int ins_idx) const {
     int64_t estimated_block_mem_bytes_value = get_estimated_block_mem_bytes();
     DCHECK_GT(estimated_block_mem_bytes_value, 0);
 
-    int64_t max_count = std::max(1L, mem_limit_value / 
estimated_block_mem_bytes_value);
+    int64_t max_count = std::max<int64_t>(1, mem_limit_value / 
estimated_block_mem_bytes_value);
     int64_t avail_count = max_count;
     int64_t per_count = avail_count / parallelism;
     if (serial_operator) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to