mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
merge fixes
This commit is contained in:
parent
52f644c0df
commit
03450d5077
@ -22,18 +22,6 @@ set(SRCS
|
|||||||
"${LIBCXXABI_SOURCE_DIR}/src/stdlib_typeinfo.cpp"
|
"${LIBCXXABI_SOURCE_DIR}/src/stdlib_typeinfo.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
|
||||||
static thread_local int foo;
|
|
||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" HAS_THREAD_LOCAL)
|
|
||||||
|
|
||||||
set(COMPILE_DEFINITIONS "-D_LIBCPP_BUILDING_LIBRARY")
|
|
||||||
if (HAS_THREAD_LOCAL)
|
|
||||||
set(COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} -DHAS_THREAD_LOCAL")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(cxxabi ${SRCS})
|
add_library(cxxabi ${SRCS})
|
||||||
set_target_properties(cxxabi PROPERTIES FOLDER "contrib/libcxxabi-cmake")
|
set_target_properties(cxxabi PROPERTIES FOLDER "contrib/libcxxabi-cmake")
|
||||||
|
|
||||||
@ -45,7 +33,7 @@ target_include_directories(cxxabi SYSTEM BEFORE
|
|||||||
PRIVATE $<BUILD_INTERFACE:${LIBCXXABI_SOURCE_DIR}/../libcxx/include>
|
PRIVATE $<BUILD_INTERFACE:${LIBCXXABI_SOURCE_DIR}/../libcxx/include>
|
||||||
PRIVATE $<BUILD_INTERFACE:${LIBCXXABI_SOURCE_DIR}/../libcxx/src>
|
PRIVATE $<BUILD_INTERFACE:${LIBCXXABI_SOURCE_DIR}/../libcxx/src>
|
||||||
)
|
)
|
||||||
target_compile_definitions(cxxabi PRIVATE ${COMPILE_DEFINITIONS})
|
target_compile_definitions(cxxabi PRIVATE -D_LIBCPP_BUILDING_LIBRARY -DHAS_THREAD_LOCAL)
|
||||||
target_compile_options(cxxabi PRIVATE -nostdinc++ -fno-sanitize=undefined -Wno-macro-redefined) # If we don't disable UBSan, infinite recursion happens in dynamic_cast.
|
target_compile_options(cxxabi PRIVATE -nostdinc++ -fno-sanitize=undefined -Wno-macro-redefined) # If we don't disable UBSan, infinite recursion happens in dynamic_cast.
|
||||||
target_link_libraries(cxxabi PUBLIC unwind)
|
target_link_libraries(cxxabi PUBLIC unwind)
|
||||||
|
|
||||||
|
@ -1087,12 +1087,11 @@ bool CachedOnDiskReadBufferFromFile::nextImplStep()
|
|||||||
first_offset,
|
first_offset,
|
||||||
file_segments->toString());
|
file_segments->toString());
|
||||||
|
|
||||||
if (file_offset_of_buffer_end > current_read_range.right)
|
|
||||||
completeFileSegmentAndGetNext();
|
|
||||||
|
|
||||||
/// Release buffer a little bit earlier.
|
/// Release buffer a little bit earlier.
|
||||||
if (read_until_position == file_offset_of_buffer_end)
|
if (read_until_position == file_offset_of_buffer_end)
|
||||||
implementation_buffer.reset();
|
implementation_buffer.reset();
|
||||||
|
else if (file_offset_of_buffer_end > current_read_range.right)
|
||||||
|
completeFileSegmentAndGetNext();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1294,7 +1293,7 @@ static bool isRangeContainedInSegments(size_t left, size_t right, const FileSegm
|
|||||||
bool CachedOnDiskReadBufferFromFile::isContentCached(size_t offset, size_t size)
|
bool CachedOnDiskReadBufferFromFile::isContentCached(size_t offset, size_t size)
|
||||||
{
|
{
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
initialize(file_offset_of_buffer_end, getTotalSizeToRead());
|
initialize();
|
||||||
|
|
||||||
return isRangeContainedInSegments(offset, std::min(offset + size, read_until_position) - 1, file_segments);
|
return isRangeContainedInSegments(offset, std::min(offset + size, read_until_position) - 1, file_segments);
|
||||||
}
|
}
|
||||||
|
@ -140,8 +140,6 @@ public:
|
|||||||
bool contains(const Range & other) const { return contains(other.left) && contains(other.right); }
|
bool contains(const Range & other) const { return contains(other.left) && contains(other.right); }
|
||||||
|
|
||||||
String toString() const { return fmt::format("[{}, {}]", std::to_string(left), std::to_string(right)); }
|
String toString() const { return fmt::format("[{}, {}]", std::to_string(left), std::to_string(right)); }
|
||||||
|
|
||||||
bool contains(size_t offset) const { return left <= offset && offset <= right; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static String getCallerId();
|
static String getCallerId();
|
||||||
|
Loading…
Reference in New Issue
Block a user