-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of malloc symbols in libcommon #7065
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,7 @@ set(dbms_sources) | |
add_headers_and_sources(clickhouse_common_io src/Common) | ||
add_headers_and_sources(clickhouse_common_io src/Common/HashTable) | ||
add_headers_and_sources(clickhouse_common_io src/IO) | ||
list (REMOVE_ITEM clickhouse_common_io_sources src/Common/new_delete.cpp) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is special about this file so that we need to move it in a separate lib? |
||
|
||
if(USE_RDKAFKA) | ||
add_headers_and_sources(dbms src/Storages/Kafka) | ||
|
@@ -139,6 +140,9 @@ endif () | |
|
||
add_library(clickhouse_common_io ${clickhouse_common_io_headers} ${clickhouse_common_io_sources}) | ||
|
||
add_library (clickhouse_new_delete STATIC src/Common/new_delete.cpp) | ||
target_link_libraries (clickhouse_new_delete clickhouse_common_io) | ||
|
||
if (OS_FREEBSD) | ||
target_compile_definitions (clickhouse_common_io PUBLIC CLOCK_MONOTONIC_COARSE=CLOCK_MONOTONIC_FAST) | ||
endif () | ||
|
@@ -419,17 +423,7 @@ endif() | |
|
||
if (USE_JEMALLOC) | ||
dbms_target_include_directories (SYSTEM BEFORE PRIVATE ${JEMALLOC_INCLUDE_DIR}) # used in Interpreters/AsynchronousMetrics.cpp | ||
target_include_directories (clickhouse_common_io SYSTEM BEFORE PRIVATE ${JEMALLOC_INCLUDE_DIR}) # new_delete.cpp | ||
# common/memory.h | ||
if (MAKE_STATIC_LIBRARIES OR NOT SPLIT_SHARED_LIBRARIES) | ||
# skip if we have bundled build, since jemalloc is static in this case | ||
elseif (${JEMALLOC_LIBRARIES} MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$") | ||
# if the library is static we do not need to link with it, | ||
# since in this case it will be in libs/libcommon, | ||
# and we do not want to link with jemalloc multiple times. | ||
else() | ||
target_link_libraries(clickhouse_common_io PRIVATE ${JEMALLOC_LIBRARIES}) | ||
endif() | ||
target_include_directories (clickhouse_new_delete SYSTEM BEFORE PRIVATE ${JEMALLOC_INCLUDE_DIR}) | ||
endif () | ||
|
||
dbms_target_include_directories (PUBLIC ${DBMS_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/Formats/include) | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_executable(test-connect test_connect.cpp) | ||
target_link_libraries (test-connect dbms) | ||
target_link_libraries (test-connect PRIVATE dbms) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_executable (mysqlxx_test mysqlxx_test.cpp) | ||
target_link_libraries (mysqlxx_test mysqlxx) | ||
target_link_libraries (mysqlxx_test PRIVATE mysqlxx) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just link clickhouse_new_delete everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because clickhouse_new_delete provide
operator::new/delete
symbol interposition in libcxx/stdlibc++, which is similar tomalloc
. I'd like to make this strategy consistent.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because I assume only executables under dbms require memory tracking.