Skip to content

add: iovec_to_iovec routine (#241)#242

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

add: iovec_to_iovec routine (#241)#242
VasilyStepanov merged 1 commit intoreleases/v0.1from
v0.1/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 core utility function, rawstor_iovec_to_iovec, to the rawstorstd library, enabling more flexible and efficient data transfer between scattered memory buffers. Concurrently, the testing suite has been modernized to improve memory management and ensure robust validation of this new capability, enhancing the library's overall reliability 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.
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 copies data from a source iovec array to a destination iovec array, starting from a specified offset in the source.
  • librawstorstd/tests/test_iovec.cpp
    • Included <list> and <string> headers for new test infrastructure.
    • Refactored the IOVecTest class to use std::list<std::string> for managing source data, eliminating manual memory allocation and deallocation.
    • Added a new test case, TEST_F(IOVecTest, to_iovec), to thoroughly validate the functionality of the rawstor_iovec_to_iovec function.
Activity
  • No human activity has been recorded on this pull request yet.
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 modernizes the test suite by using std::list<std::string> for data management, which is a great improvement. The new function is well-structured, but I've found a couple of issues: a critical portability issue due to pointer arithmetic on void*, and a high-severity bug where copying stops prematurely on zero-length buffers. I've also suggested improving the test coverage to catch such bugs in the future. Overall, a valuable addition with a few corrections needed.

@VasilyStepanov VasilyStepanov merged commit 941735a into releases/v0.1 Feb 3, 2026
19 checks passed
@VasilyStepanov VasilyStepanov deleted the v0.1/iovec branch February 3, 2026 12:10
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