Skip to content

ICU-21356 Fix memory handling in MemoryPool::operator=()#1437

Merged
hugovdm merged 1 commit intounicode-org:masterfrom
hugovdm:measunitimpl
Oct 29, 2020
Merged

ICU-21356 Fix memory handling in MemoryPool::operator=()#1437
hugovdm merged 1 commit intounicode-org:masterfrom
hugovdm:measunitimpl

Conversation

@hugovdm
Copy link
Copy Markdown
Contributor

@hugovdm hugovdm commented Oct 28, 2020

Question to reviewer: indirectly testing this via MeasureUnitImpl: sufficient? Or should I produce a unit test specifically for a MemoryPool instance?

The old array can't simply be deallocated, their pointers still need to be deallcoated too.

Using swap() ensures that the destructor can take care of it when other is deallocated.

Checklist

@jira-pull-request-webhook
Copy link
Copy Markdown

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

Copy link
Copy Markdown
Member

@roubert roubert left a comment

Choose a reason for hiding this comment

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

I think this change makes sense, please just clean up the commits and make sure that all tests pass.

@hugovdm hugovdm requested a review from roubert October 28, 2020 15:47
@hugovdm
Copy link
Copy Markdown
Contributor Author

hugovdm commented Oct 28, 2020

I'm doing the usual leaving of squashing until after a reviewer is happy: an extra round trip, but makes review comments and reviewing diffs more streamlined.

Copy link
Copy Markdown
Member

@roubert roubert left a comment

Choose a reason for hiding this comment

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

The changes to cmemory.h look good to me now, I'll leave it to @sffc to review the changes to the units code.

@jira-pull-request-webhook
Copy link
Copy Markdown

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@hugovdm hugovdm dismissed roubert’s stale review October 29, 2020 11:13

roubert: "The changes to cmemory.h look good to me now", and sffc has now also approved.

@hugovdm
Copy link
Copy Markdown
Contributor Author

hugovdm commented Oct 29, 2020

appveyor timed out: "Build execution time has reached the maximum allowed time for your plan (60 minutes)."

Merging!

@hugovdm hugovdm merged commit 7c8f857 into unicode-org:master Oct 29, 2020
@hugovdm hugovdm deleted the measunitimpl branch October 29, 2020 11:14
sffc pushed a commit that referenced this pull request Dec 2, 2020
sffc pushed a commit that referenced this pull request Dec 9, 2020
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.

3 participants