Closed Bug 1665661 Opened 4 years ago Closed 4 years ago

Make UnusedZero<WindowsError>::value true to enable Result optimizations

Categories

(Core :: Widget: Win32, task)

task

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: sg, Assigned: sg)

References

Details

Attachments

(1 file)

WindowsError has the same layout as HRESULT and a S_OK HRESULT is 0, so an error can never be 0. For such cases, mozilla::Result provides optimizations, which need to be opted in by providing a specialization of UnusedZero, like it's done for nsresult. In particular, this allows to not use mozilla::Variant inside the mozilla::Result implementation, which seems to be hard to optimize away.

Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED
Depends on: 1667019
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/46c0b8ec1432
Opt into UnusedZero<WindowsError>::value == true to enable mozilla::Result optimizations. r=aklotz
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: