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

GH-37891: [C++] Pass shared_ptr<DataType> by value in SliceBuffer-related constructors #45466

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chrisxu333
Copy link

@chrisxu333 chrisxu333 commented Feb 7, 2025

Rationale for this change

These changes facilitate the process of moving newly constructed shared_ptr without the need of adding a refcount and still support cases where a reference of a shared_ptr is passed from caller.

What changes are included in this PR?

  • Change SliceBuffer-related constructor to take shared_ptr by value instead of const &.
  • Change SliceBufferSafe-related constructor to take shared_ptr by value instead of const &.
  • Change SliceMutableBufferSafe -related constructors to take shared_ptr by value instead of const &.

Are these changes tested?

Yes.

Are there any user-facing changes?

  • The SliceBuffer() function now take the shared_ptr parameter value instead of const &.

@pitrou
Copy link
Member

pitrou commented Feb 10, 2025

@chrisxu333 The changes look good to me, but can you ensure the PR title accurately describes its contents? Thank you!

@chrisxu333
Copy link
Author

@chrisxu333 The changes look good to me, but can you ensure the PR title accurately describes its contents? Thank you!

Sure will do. Also there're more changes to make besides this, I made this one first just to confirm my understanding aligns with the need :)

@chrisxu333 chrisxu333 changed the title GH-37891: [C++] wip GH-37891: [C++] Pass shared_ptr<DataType> by value in SliceBuffer-related constructors Feb 16, 2025
@pitrou
Copy link
Member

pitrou commented Feb 17, 2025

@chrisxu333 It seems the CI actions were skipped because your PR very recently had "wip" in its title :) If you push another commit it will hopefully allow triggering a full CI run.

@chrisxu333
Copy link
Author

@chrisxu333 It seems the CI actions were skipped because your PR very recently had "wip" in its title :) If you push another commit it will hopefully allow triggering a full CI run.

Sure, I changed it already. Could you please help review this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants