Closed
Bug 1216611
Opened 10 years ago
Closed 10 years ago
add a MakeUniqueFallible<T[]> (and maybe <T>) function
Categories
(Core :: MFBT, defect)
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: froydnj, Unassigned)
Details
Attachments
(2 files)
|
13.24 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
|
2.07 KB,
patch
|
froydnj
:
feedback+
ritu
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
In converting a few nsAuto*Ptr things to UniquePtr, one pattern that comes up is:
mAutoPtr = new (fallible) T[...];
which has to be converted like so:
mUniquePtr.reset(new (fallible) T[...]);
I think converting it like so would be nicer:
mUniquePtr = MakeUniqueFallible<T[]>(...);
which is a little longer, but reads a little more idiomatically and doesn't use |new|.
Comment 1•10 years ago
|
||
Reasonable. Separate header from the existing, is all I want here. :-) If we adopt <memory> at some point, want to keep extensions separated out.
Comment 2•10 years ago
|
||
How about mUniquePtr = MakeUnique<T[]>(..., fallible) ?
Comment 3•10 years ago
|
||
Don't think so. It seems very worth preserving the sense that the arguments passed in, are exactly passed along. Not to mention there'd then be ambiguity with a constructor that took a |fallible| as its last argument.
| Reporter | ||
Comment 4•10 years ago
|
||
Chose to call the file MakeUniqueExtensions in case we ever want to have
UniqueFreePtr etc.
Attachment #8682614 -
Flags: review?(jwalden+bmo)
Updated•10 years ago
|
Attachment #8682614 -
Flags: review?(jwalden+bmo) → review+
Comment 6•10 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 7•10 years ago
|
||
Approval Request Comment
[Feature/regressing bug #]: none
[User impact if declined]: need this to uplift bug 1235605
[Describe test coverage new/current, TreeHerder]: none
[Risks and why]: safe
[String/UUID change made/needed]: none
Attachment #8703908 -
Flags: feedback?(nfroyd)
Attachment #8703908 -
Flags: approval-mozilla-beta?
| Reporter | ||
Comment 8•10 years ago
|
||
Comment on attachment 8703908 [details] [diff] [review]
header only uplift for beta
Review of attachment 8703908 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM!
Attachment #8703908 -
Flags: feedback?(nfroyd) → feedback+
Comment on attachment 8703908 [details] [diff] [review]
header only uplift for beta
Need to fix a sec-mod issue. Beta44+
Attachment #8703908 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
status-firefox44:
--- → affected
Comment 10•10 years ago
|
||
| bugherder uplift | ||
Comment 11•10 years ago
|
||
| bugherder uplift | ||
status-b2g-v2.5:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•