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

ARROW-2539: [Plasma] Use unique_ptr instead of raw pointer #1993

Closed
wants to merge 5 commits into from

Conversation

zhijunfu
Copy link
Contributor

@zhijunfu zhijunfu commented May 4, 2018

use unique_ptr to replace raw pointer, so that allocated memory can be freed automatically

@xhochy
Copy link
Member

xhochy commented May 4, 2018

Instead of using uint8_t[] we could also use std::vector<uint8_t> to better track the memory.

@zhijunfu zhijunfu changed the title [Plasma] Use unique_ptr instead of raw pointer ARROW-2539: [Plasma] Use unique_ptr instead of raw pointer May 4, 2018
@zhijunfu
Copy link
Contributor Author

zhijunfu commented May 4, 2018

@xhochy Thanks for the comment. I checked current plasma code and it uses unique_ptr<uint8_t[]> for similar cases when wrapping a raw pointer, it seems that using unique_ptr is more consistent with the rest of code compared to using a vector.

@pcmoritz
Copy link
Contributor

pcmoritz commented May 4, 2018

Thanks for doing this, it is definitely an improvement! I'm going to merge and then we can see if it is possible to get rid of this and the other uint8_t* and replace them by vectors in the rest of the codebase.

@pcmoritz pcmoritz changed the title ARROW-2539: [Plasma] Use unique_ptr instead of raw pointer ARROW-2539: [Plasma] Use unique_ptr instead of raw pointer May 4, 2018
@pcmoritz pcmoritz closed this in b916c79 May 4, 2018
@zhijunfu
Copy link
Contributor Author

zhijunfu commented May 5, 2018

Thanks Philipp:)

@pcmoritz
Copy link
Contributor

pcmoritz commented May 8, 2018

@zhijunfu Do you have an idea if this issue could be related to the change: https://issues.apache.org/jira/browse/ARROW-2552

It could also be 0f07171 or the combination of the two (?)

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.

None yet

3 participants