Open
Conversation
Contributor
Author
ehds
reviewed
Oct 23, 2023
| endif() | ||
| if(NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-aligned-new") | ||
| if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) |
Contributor
There was a problem hiding this comment.
我看 CMakeLists 也有判断 Clang 的逻辑,这里是否也需要对 Clang 编译器生效?
|
The solution is not sophisticated in my opinion. The brpc header file may be included in other translation units, which could be not aligned-new, so the final artifact will be a mixture of aligned-new and non-aligned-new. |
Contributor
|
所以,看上去这个问题是brpc单方面解决不了的,需要用户和bRPC框架的共同配合才行,是这么理解吧。 |
Contributor
是的。如果用户使用 brpc 提供的默认 CMakeLists 来编译安装,但是在项目中又开启了该参数就会引发这个问题,两者要保持。 我的理解是:既然某些类显示的标注了 CacheLine 对齐,如果编译器支持,那么尽量就是用对齐的分配方式,来达到 CacheLine 对齐所带来的益处。 |
Contributor
|
brpc的默认行为和编译器的默认行为保持一致这样是不是不容易产生问题。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: #2416
Problem Summary:
What is changed and the side effects?
Changed:
Side effects:
Performance effects(性能影响):
Breaking backward compatibility(向后兼容性):
Check List: