merge fixes

This commit is contained in:
Nikita Taranov 2023-11-28 18:14:36 +01:00
parent 52f644c0df
commit 03450d5077
3 changed files with 4 additions and 19 deletions

View File

@ -22,18 +22,6 @@ set(SRCS
"${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})
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/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_link_libraries(cxxabi PUBLIC unwind)

View File

@ -1087,12 +1087,11 @@ bool CachedOnDiskReadBufferFromFile::nextImplStep()
first_offset,
file_segments->toString());
if (file_offset_of_buffer_end > current_read_range.right)
completeFileSegmentAndGetNext();
/// Release buffer a little bit earlier.
if (read_until_position == file_offset_of_buffer_end)
implementation_buffer.reset();
else if (file_offset_of_buffer_end > current_read_range.right)
completeFileSegmentAndGetNext();
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)
{
if (!initialized)
initialize(file_offset_of_buffer_end, getTotalSizeToRead());
initialize();
return isRangeContainedInSegments(offset, std::min(offset + size, read_until_position) - 1, file_segments);
}

View File

@ -140,8 +140,6 @@ public:
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)); }
bool contains(size_t offset) const { return left <= offset && offset <= right; }
};
static String getCallerId();