Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory size in create_byte_range_infos_consecutive #16012

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

davidwendt
Copy link
Contributor

Description

Fixes over allocated memory for range vector in cudf::io::text::create_byte_range_infos_consecutive

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels Jun 12, 2024
@davidwendt davidwendt self-assigned this Jun 12, 2024
@davidwendt davidwendt requested a review from a team as a code owner June 12, 2024 19:20
@@ -31,7 +31,7 @@ std::vector<byte_range_info> create_byte_range_infos_consecutive(int64_t total_b
auto range_size = util::div_rounding_up_safe(total_bytes, range_count);
Copy link
Member

Choose a reason for hiding this comment

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

Minor suggestion: Though not a part of this PR change set but range_size could be made const.

Copy link
Member

Choose a reason for hiding this comment

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

Nvm, just checked that the return type of div_rounding_up_safe is constexpr anyway so auto should be good!

Copy link
Contributor

@karthikeyann karthikeyann Jun 18, 2024

Choose a reason for hiding this comment

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

The function div_rounding_up_safe is constexpr. AFAIK, constexpr does not apply to return type. Return type is I, here int64_t.
range_size should be int64_t.

https://godbolt.org/z/9seajen4e

@davidwendt
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit ac3c8dd into rapidsai:branch-24.08 Jun 24, 2024
77 checks passed
@davidwendt davidwendt deleted the fix-byte-range-mem branch June 24, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants