Closed Bug 1271471 Opened 9 years ago Closed 4 years ago

Eliminate MaybePrefValue

Categories

(Core :: DOM: Content Processes, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1536163
Tracking Status
firefox49 --- affected

People

(Reporter: mccr8, Assigned: rofael, Mentored)

Details

(Whiteboard: btpp-backlog)

MaybePrefValue is defined as a union, but PrefValue is also a union, so it might be okay to inline MaybePrefValue into PrefValue. If I'm reading the generated code correctly, this will save one word per PrefValue. Or maybe one byte. There can be a few thousand of these, so it would not be a large gain. It might also make it easier to manipulate these values.
Whiteboard: bttp-backlog
Mentor: continuation
This would make a good little introductory bug for messing around with IPDL from C++.
Whiteboard: bttp-backlog → btpp-backlog
Both prefValues have to be the same type, so another approach would be to replace the pair of unions with a union of pairs of unions. Maybe that's not better, in terms of size.
Priority: -- → P3
So would this require changing PrefValue to union PrefValue { nsCString; int32_t; bool; union MaybePrefValue { PrefValue; null_t; }; }; and prepending PrefValue:: in front of any MaybePrefValue::?
Flags: needinfo?(continuation)
I think I was thinking of something more like union PrefValue { nsCString; int32_t; bool; null_t; }; I'm not sure how well that will work on the C++ side.
Flags: needinfo?(continuation)
Seems like a good ol' "delete and fix compilation errors". I'll pick it up. Might not get to it for a week or two, though.
Assignee: nobody → me
Status: NEW → ASSIGNED

Fixed in bug 1536163.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.