diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c70bde4..d752a77 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -63,8 +63,8 @@ add_compile_definitions(_BITS_UIO_EXT_H=1) set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer") set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer") -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -march=native -mtune=native ") # -pg -set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -march=native -mtune=native") # -pg +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer") +set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer") if(APPLE) set(BACKTRACE_DEPENDENCY "") diff --git a/src/llfs/ioring_stream_buffer.cpp b/src/llfs/ioring_stream_buffer.cpp index 80cf8bd..3bd98c9 100644 --- a/src/llfs/ioring_stream_buffer.cpp +++ b/src/llfs/ioring_stream_buffer.cpp @@ -237,6 +237,24 @@ void IoRingStreamBuffer::Fragment::push(BufferView&& view) this->views_.emplace_back(std::move(view)); } +//==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - - +// +void IoRingStreamBuffer::Fragment::push(const Fragment& fragment) +{ + for (const BufferView& part : fragment.views_) { + this->push(batt::make_copy(part)); + } +} + +//==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - - +// +void IoRingStreamBuffer::Fragment::push(Fragment&& fragment) +{ + for (BufferView& part : fragment.views_) { + this->push(std::move(part)); + } +} + //==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - - // auto IoRingStreamBuffer::Fragment::pop(usize max_byte_count) -> Fragment diff --git a/src/llfs/ioring_stream_buffer.hpp b/src/llfs/ioring_stream_buffer.hpp index f7351d6..363e215 100644 --- a/src/llfs/ioring_stream_buffer.hpp +++ b/src/llfs/ioring_stream_buffer.hpp @@ -74,6 +74,15 @@ class IoRingStreamBuffer */ void push(BufferView&& view); + /** \brief Pushes the specified Fragment onto the end of this sequence. + */ + void push(const Fragment& other); + + /** \brief Pushes the specified Fragment onto the end of this sequence, consuming the Fragment + * in the process. + */ + void push(Fragment&& other); + /** \brief Removes up to the specified number of bytes from the beginning of this sequence, * returning the resulting BufferView slices as a Fragment. */