This is an archive of the discontinued LLVM Phabricator instance.

[FIX] Make LSan happy by *not* leaking memory
AbandonedPublic

Authored by jdoerfert on Oct 31 2019, 10:09 AM.

Details

Reviewers
None

Event Timeline

jdoerfert created this revision.Oct 31 2019, 10:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2019, 10:09 AM

Looks like this was sent for review but no one reviewed/approved it? Generally, if something is sent for review, it's not great to submit it without review. (if you felt it needed review to begin with, time shouldn't change that)

Any chance of using unique_ptrs here, instead of raw pointers and DeleteContainerPointers?

Looks like this was sent for review but no one reviewed/approved it? Generally, if something is sent for review, it's not great to submit it without review. (if you felt it needed review to begin with, time shouldn't change that)

The review was intended to share the patch and validate the fix, that is why I didn't add reviewers. I will not open a review next time.

Any chance of using unique_ptrs here, instead of raw pointers and DeleteContainerPointers?

I can do that if you want me to. FWIW, it is a printer pass so I don't feel a strong need to improve performance here and I doubt there is "active development" on this part.

Looks like this was sent for review but no one reviewed/approved it? Generally, if something is sent for review, it's not great to submit it without review. (if you felt it needed review to begin with, time shouldn't change that)

The review was intended to share the patch and validate the fix, that is why I didn't add reviewers. I will not open a review next time.

Validate in what sense? There didn't appear to be any discussion/validation from other developers here.

Any chance of using unique_ptrs here, instead of raw pointers and DeleteContainerPointers?

I can do that if you want me to. FWIW, it is a printer pass so I don't feel a strong need to improve performance here and I doubt there is "active development" on this part.

Ah, it wasn't so much about performance (I don't expect the unique_ptr solution to be any faster) but readability/maintainability - unique_ptr makes it harder to reintroduce bugs if someone adds an early return to that function or otherwise refactors it.

Looks like this was sent for review but no one reviewed/approved it? Generally, if something is sent for review, it's not great to submit it without review. (if you felt it needed review to begin with, time shouldn't change that)

The review was intended to share the patch and validate the fix, that is why I didn't add reviewers. I will not open a review next time.

Validate in what sense? There didn't appear to be any discussion/validation from other developers here.

As far as I can recall, I was pinged on IRC and made aware of the leak, the patch was put here, run on their end to verify, then pushed and closed.

Any chance of using unique_ptrs here, instead of raw pointers and DeleteContainerPointers?

I can do that if you want me to. FWIW, it is a printer pass so I don't feel a strong need to improve performance here and I doubt there is "active development" on this part.

Ah, it wasn't so much about performance (I don't expect the unique_ptr solution to be any faster) but readability/maintainability - unique_ptr makes it harder to reintroduce bugs if someone adds an early return to that function or otherwise refactors it.

I do not disagree. Will try to make it happen once I find the time.