AnDiXL commented on code in PR #3698:
URL: https://github.com/apache/brpc/pull/3698#discussion_r4438818883


##########
CMakeLists.txt:
##########
@@ -150,6 +150,15 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     endif()
 endif()
 
+# Cacheline-aligned types such as ResourcePool<Socket> are created with plain
+# `new'. C++17 honors their alignment by default, C++14 only with
+# -faligned-new; without it glibc returns 16-byte aligned storage.
+include(CheckCXXCompilerFlag)
+check_cxx_compiler_flag(-faligned-new BRPC_HAS_ALIGNED_NEW)

Review Comment:
   Fixed. The check now compiles and links an `alignas(64)` type that is 
allocated and deleted, with `-std=c++N -faligned-new`, so a runtime without the 
aligned `operator new` fails at configure time.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to