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

Only instantiate moveit-style constructors and implement make_unique in terms of them #742

Closed
wants to merge 7 commits into from

Conversation

adetaylor
Copy link
Collaborator

No description provided.

@adetaylor
Copy link
Collaborator Author

Having thought this through, I don't think this is the right approach. It simplifies things a bit, but not much because we still need to instantiate the alloc/dealloc functions for each type.

More seriously, this means we'd be calling std::allocator to allocate each heap cell. I suspect that's no good if a type has an overridden operator new; we might end up allocating things on the wrong heap.

The approach prior to this PR will have ended up directly calling the operator new by means of make_unique and thus would have put things on the correct heap. It would be a regression for us to land this PR, so I'm not going to. There may still be opportunities to simplify the synthesis of make_unique functions some other way.

@adetaylor adetaylor closed this Jan 27, 2022
@adetaylor
Copy link
Collaborator Author

This will be OK once we've fixed #772 so reopening. (The whole PR needs redoing, though.)

Previously we didn't populate a destructor (Drop) trait for a synthesized
subclass even if the superclass had a destructor. We should have done.

The general problem of derived classes being unaware of their superclass
destructors is #988. The present fix only applies to synthesized subclasses.

As well as being incorrect, this also prevented subclasses gaining a
make_unique method.
@adetaylor adetaylor force-pushed the constructors-always-via-moveit branch from 9f3bf7e to 0035433 Compare April 2, 2022 04:47
@adetaylor
Copy link
Collaborator Author

We'll do #1040 instead. We deprecated the make_unique a few releases ago.

@adetaylor adetaylor closed this Apr 18, 2022
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.

1 participant