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

[REVIEW] [CUIO] Replace owning raw pointers with std::unique_ptr #5720

Merged
merged 12 commits into from
Jul 21, 2020

Conversation

vuule
Copy link
Contributor

@vuule vuule commented Jul 18, 2020

HostDecompressor::Create used to return a raw pointer to a newly created object. Because of this, the caller had a destructor.
With this PR, a unique_ptr is returned instead, and the caller's destructor is removed.

@vuule vuule added cuIO cuIO issue tech debt labels Jul 18, 2020
@vuule vuule self-assigned this Jul 18, 2020
@GPUtester
Copy link
Collaborator

Please update the changelog in order to start CI tests.

View the gpuCI docs here.

@vuule vuule changed the title [CUIO] Replace an owning raw pointer with a std::unique_ptr [CUIO] Replace owning raw pointers with std::unique_ptr Jul 18, 2020
@codecov
Copy link

codecov bot commented Jul 18, 2020

Codecov Report

❗ No coverage uploaded for pull request base (branch-0.15@d8705fe). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##             branch-0.15    #5720   +/-   ##
==============================================
  Coverage               ?   86.38%           
==============================================
  Files                  ?       76           
  Lines                  ?    13041           
  Branches               ?        0           
==============================================
  Hits                   ?    11265           
  Misses                 ?     1776           
  Partials               ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8705fe...41f4ee2. Read the comment docs.

@vuule vuule marked this pull request as ready for review July 18, 2020 22:27
@vuule vuule requested a review from a team as a code owner July 18, 2020 22:27
@vuule vuule requested review from trxcllnt and trevorsm7 July 18, 2020 22:27
@vuule vuule changed the title [CUIO] Replace owning raw pointers with std::unique_ptr [REVIEW] [CUIO] Replace owning raw pointers with std::unique_ptr Jul 18, 2020
Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

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

Looks great, just a question about the exceptional case.

}
return decompressor;
return {};
Copy link
Member

Choose a reason for hiding this comment

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

Should you throw / CUDF_FAIL here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This keeps the original behavior - return null if the compression type is not supported.

I'll check if null is actually signalling an error here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, returning null here causes an error later on, when trying to parse the data that was never successfully read. Added CUDF_FAIL, removed code that assumes that the decompressor can be null.

Copy link
Contributor

@trevorsm7 trevorsm7 left a comment

Choose a reason for hiding this comment

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

Looks much better

@vuule vuule merged commit ed84164 into rapidsai:branch-0.15 Jul 21, 2020
@vuule vuule deleted the remove-cuio-new-calls branch July 21, 2020 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuIO cuIO issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants