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

Eliminate copies in deferred cleanup #3035

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

TimSylvester
Copy link
Collaborator

Pulls in an implementation of move_only_function.

This simplifies deferred deletions, since there's no temporary copy to potentially outlast the schedule call, and eliminates the need to convert unique_ptrs to shared_ptrs.

Unfortunately, the change of function types for the scheduler spreads to the map callbacks due to usage like:

pathChangeCallback = Scheduler::GetCurrent()->bindOnce(...

This is further complicated by the fact that of the callbacks are explicitly copied:

void FileSourceRequest::setResponse(const Response& response) {
    // Copy, because calling the callback will sometimes self
    // destroy this object. We cannot move because this method
    // can be called more than once.

Also fixes various style warnings.

Working in Android and ios so far.

Is this worth pursuing further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant