Use ManuallyDrop in the rust representation of style structs.
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio)
References
Details
Attachments
(1 file)
This allows us to not run destructors of any members of nsStyle*, which in turn allows us to:
- Remove the hack that replaced all nsStrings for nsStringReprs.
- Remove ns{,C}StringRepr (followup)
- Add members with destructors to the style structs (you see where I'm going :)).
Assignee | ||
Comment 1•5 years ago
|
||
We destroy them manually, so it's the right thing to do.
This allows us to not run destructors of any members of nsStyle*, which in turn allows us to:
- Remove the hack that replaced all nsStrings for nsStringReprs.
- Remove ns{,C}StringRepr (followup)
- Add members with destructors to the style structs (you see where I'm going :)).
Comment 2•5 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #1)
- Add members with destructors to the style structs (you see where I'm going :)).
Can you say what your desired end state is here? That would help in reviewing the direction of these patches. I'm guessing it's towards using more and more Rust types for the style struct members, or perhaps defining the style structs entirely on the Rust side?
Assignee | ||
Comment 3•5 years ago
|
||
Yes. Generally this allows to have rust-defined slices and such in style structs (see bug 1550554 for an example where this allows us to avoid doing silly copies for box shadows and such and clean up a bunch of stuff).
But I think regardless of that, this patch is necessary. What we have right now is a real footgun (see the nsStringRepr stuff to avoid double-freeing strings in style structs on drop).
Defining eventually all the structs in rust would be great. For now I'm just trying to remove the most complex glue code as time and such permits.
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2d0e8bded97a Use ManuallyDrop for style structs. r=jwatt
Comment 5•5 years ago
|
||
Backed out changeset 2d0e8bded97a (Bug 1550377) for build bustages on self.gecko
.
Backout: https://hg.mozilla.org/integration/autoland/rev/251671a74d95593d789639a9288e935346f457c9
Push that started the failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=pending%2Crunning%2Csuccess%2Ctestfailed%2Cbusted%2Cexception&revision=2d0e8bded97ab21731f1577fcf093595aec62c22&selectedJob=246511275
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=246511275&repo=autoland&lineNumber=25107
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/21897fb59491 Use ManuallyDrop for style structs. r=jwatt
Assignee | ||
Updated•5 years ago
|
Comment 7•5 years ago
|
||
bugherder |
Description
•