Closed Bug 1561866 Opened 5 years ago Closed 5 years ago

Move AllocPolicy instances where possible

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(1 file)

Most of our data structures are templated on an AllocPolicy type that is responsible for allocating/freeing memory. Instances of this type are passed by value between data structure constructors and may end up being copied several times.

We should allow these to be moved where possible. This is useful for bug 1395509 where ZoneAllocPolicy is used to track allocated memory.

Patch to use std::move when passing AllocPolicy instances to constructors. This also fixes HashTable move constuction/assignment that previously PodAssigned the whole object including the AllocPolicy base.

Depends on D35798

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1621ba12b292
Move alloc policies where possible r=jwalden
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4b1b5ac83037
Refactor HashTable move constructor/assignment operator as per review comments, missed from previous push r=jwalden
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: