Remove mozilla::Pair
Categories
(Core :: MFBT, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox76 | --- | fixed |
People
(Reporter: ekr, Assigned: fronkc1)
References
Details
Attachments
(1 external file, 1 obsolete file)
| Assignee | ||
Comment 1•6 years ago
|
||
Updated•6 years ago
|
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
Not sure if this is still wanted but put at patch up to show what changes it would take. Used tuple for UniquePtr to keep the compiler asserts passing otherwise pretty straightforward
Comment 4•6 years ago
|
||
Thanks for tackling this!
However, I am not sure if mozilla::Pair should be completely removed. I guess https://groups.google.com/d/msg/mozilla.dev.platform/IQhGdhGxx2M/NpEHE7OguoIJ sounds like good advice in summary to me. Paraphrasing that:
- In general,
std::pairshould be preferred overmozilla::Pairunless you need the empty type optimization. mozilla::Pairshould be renamed tomozilla::CompressedPairto make the use case clearer.
Nathan, WDYT?
One more thing: you submitted two patches, which appear to do the same thing, but seem to be based on different base revisions? Could you abandon/mark one of those as obsolete?
Comment 5•6 years ago
|
||
Sorry, I missed the final part (i.e. https://groups.google.com/d/msg/mozilla.dev.platform/IQhGdhGxx2M/NJ99NV4gmfcJ) saying that mozilla::Tuple (or does it refer to std::tuple?) offers this empty type optimization as well? Then, maybe we can get rid of mozilla::Pair entirely, and just check if there are cases that are better replaced by a tuple to benefit from empty type optimization.
Comment 6•6 years ago
|
||
(In reply to Simon Giesecke [:sg] [he/him] from comment #4)
Thanks for tackling this!
However, I am not sure if
mozilla::Pairshould be completely removed. I guess https://groups.google.com/d/msg/mozilla.dev.platform/IQhGdhGxx2M/NpEHE7OguoIJ sounds like good advice in summary to me. Paraphrasing that:
- In general,
std::pairshould be preferred overmozilla::Pairunless you need the empty type optimization.mozilla::Pairshould be renamed tomozilla::CompressedPairto make the use case clearer.Nathan, WDYT?
This works for me. I have a slight preference for CompactPair as the original post suggested instead of CompressedPair, but since the number of use cases is expected to be relatively small, I don't think it matters that much.
Comment 7•6 years ago
|
||
(In reply to Nathan Froyd [:froydnj] from comment #6)
(In reply to Simon Giesecke [:sg] [he/him] from comment #4)
Thanks for tackling this!
However, I am not sure if
mozilla::Pairshould be completely removed. I guess https://groups.google.com/d/msg/mozilla.dev.platform/IQhGdhGxx2M/NpEHE7OguoIJ sounds like good advice in summary to me. Paraphrasing that:
- In general,
std::pairshould be preferred overmozilla::Pairunless you need the empty type optimization.mozilla::Pairshould be renamed tomozilla::CompressedPairto make the use case clearer.Nathan, WDYT?
This works for me. I have a slight preference for
CompactPairas the original post suggested instead ofCompressedPair, but since the number of use cases is expected to be relatively small, I don't think it matters that much.
Oh, this change was not intentional. Boost calls it boost::compressed_pair, but in fact I'd prefer CompactPair as well.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Comment 8•6 years ago
|
||
I've update the patch to rename to CompactPair and updated UniquePtr WasmOpIter.h back to use CompactPair. Let me know if there's any others you think should be switched back. Sorry for confusion with revision it updated the old one and not sure how to add reviewers back.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 10•6 years ago
|
||
Backed out changeset a08637fb30c8 (Bug 1143478) for causing bustages in /builds/worker/checkouts/gecko/ipc/mscom/Registration.cpp CLOSED TREE
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=292668381&repo=autoland&lineNumber=8633
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 14•6 years ago
|
||
This is just a commonly-used header causing sccache invalidations.
I think Nathan (froydnj) commented here already with above but if this is still issue or you need more info from me let me know
Description
•