Closed Bug 1639958 Opened 4 months ago Closed 4 months ago

Add MakeUniqueForOverwrite helpers and some usages in Buffer.

Categories

(Core :: MFBT, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: bobowen, Assigned: bobowen)

Details

Attachments

(2 files)

These patches were going to land on a different bug and were no longer needed.
They're useful additions though, so I'm moving them to this bug for landing.

These are the equivalent of std::make_unique_for_overwrite and std::make_unique_for_overwrite with fallible allocation.

This also uses MakeUniqueForOverwrite* in two places where we immediately copy
over the Buffer from a Span.
Adds move assignment operator for use in a later patch as well.

Pushed by bobowencode@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/d136262c64d7
part 1: Add MakeUniqueForOverwrite and MakeUniqueForOverwriteFallible helpers. r=froydnj
https://hg.mozilla.org/integration/autoland/rev/c0f2da5467b2
part 2: Add Buffer::AllocForOverwrite to fallibly create a default-initialized Buffer. r=froydnj
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.