Skip to content

add: iovec_to_iovec routine (#241)#243

Merged
VasilyStepanov merged 1 commit intoreleases/v0.0from
v0.0/iovec
Feb 3, 2026
Merged

add: iovec_to_iovec routine (#241)#243
VasilyStepanov merged 1 commit intoreleases/v0.0from
v0.0/iovec

Conversation

@VasilyStepanov
Copy link
Member

This pull request enhances the rawstorstd library by adding a crucial utility function for iovec operations, enabling more flexible and efficient data manipulation between scattered memory buffers. Concurrently, the testing suite has been modernized to better support and verify these new capabilities, ensuring robustness and maintainability.

Highlights

  • New iovec utility function: Introduced rawstor_iovec_to_iovec, a new function designed to efficiently copy data from a source iovec array to a destination iovec array, respecting a given offset.
  • Improved Test Infrastructure: The IOVecTest class was refactored to utilize std::list<std::string> for managing source data, simplifying memory management by removing manual malloc and free calls.
  • Comprehensive Test Coverage: Added a new test case, TEST_F(IOVecTest, to_iovec), to thoroughly validate the functionality of the newly implemented rawstor_iovec_to_iovec function under different offset and data transfer scenarios.

(cherry picked from commit 9d66b05)

This pull request enhances the `rawstorstd` library by adding a crucial utility function for `iovec` operations, enabling more flexible and efficient data manipulation between scattered memory buffers. Concurrently, the testing suite has been modernized to better support and verify these new capabilities, ensuring robustness and maintainability.

### Highlights

* **New `iovec` utility function**: Introduced `rawstor_iovec_to_iovec`, a new function designed to efficiently copy data from a source `iovec` array to a destination `iovec` array, respecting a given offset.
* **Improved Test Infrastructure**: The `IOVecTest` class was refactored to utilize `std::list<std::string>` for managing source data, simplifying memory management by removing manual `malloc` and `free` calls.
* **Comprehensive Test Coverage**: Added a new test case, `TEST_F(IOVecTest, to_iovec)`, to thoroughly validate the functionality of the newly implemented `rawstor_iovec_to_iovec` function under different offset and data transfer scenarios.

(cherry picked from commit 9d66b05)
@gemini-code-assist
Copy link

Summary of Changes

Hello @VasilyStepanov, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new utility function, rawstor_iovec_to_iovec, to the rawstorstd library, enabling flexible and efficient data transfer between scattered memory buffers. Concurrently, the testing suite has been modernized to improve memory management within tests and provide comprehensive validation for the new iovec functionality.

Highlights

  • New iovec utility function: Introduced rawstor_iovec_to_iovec, a new function designed to efficiently copy data from a source iovec array to a destination iovec array, respecting a given offset.
  • Improved Test Infrastructure: The IOVecTest class was refactored to utilize std::liststd::string for managing source data, simplifying memory management by removing manual malloc and free calls.
  • Comprehensive Test Coverage: Added a new test case, TEST_F(IOVecTest, to_iovec), to thoroughly validate the functionality of the newly implemented rawstor_iovec_to_iovec function under different offset and data transfer scenarios.
Changelog
  • librawstorstd/include/rawstorstd/iovec.h
    • Added the declaration for the new rawstor_iovec_to_iovec function.
  • librawstorstd/src/iovec.c
    • Implemented the rawstor_iovec_to_iovec function, which facilitates copying data from a source iovec array to a destination iovec array, starting from a specified offset.
  • librawstorstd/tests/test_iovec.cpp
    • Included and headers for new test infrastructure.
    • Refactored IOVecTest to use std::liststd::string for managing test data, replacing manual malloc/free with std::string's automatic memory management.
    • Added a new test case, TEST_F(IOVecTest, to_iovec), to validate the rawstor_iovec_to_iovec function with various offset and data transfer scenarios.
Activity
  • This is a new pull request with no prior activity or reviews.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new utility function, rawstor_iovec_to_iovec, for copying data between iovec arrays and refactors the test suite to use modern C++ features for better memory management. The new functionality is well-tested, and the test suite changes are a great improvement in terms of safety and readability. However, I've identified a critical bug in the implementation of the new function that could lead to incomplete data copies, as well as a portability issue related to pointer arithmetic. Please see my detailed comments below.

@VasilyStepanov VasilyStepanov merged commit e7e0834 into releases/v0.0 Feb 3, 2026
19 checks passed
@VasilyStepanov VasilyStepanov deleted the v0.0/iovec branch February 3, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant