[SERVER-60134] Passing ScopedTaskExecutor by value needlessly increases its refcount Created: 21/Sep/21 Updated: 06/Dec/22 Resolved: 23/Sep/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Matt Broadstone | Assignee: | [DO NOT USE] Backlog - Server Serverless (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Serverless
|
| Participants: |
| Description |
|
In PrimaryOnlyService::run we pass the stored shared_ptr<executor::ScopedTaskExector by value, which invokes a copy constructor and increases the refcount of the smart pointer needlessly. We should at least pass this value by const-ref. |