Closed Bug 1381560 Opened 5 years ago Closed 5 years ago

Panic reason string length is stored twice.

Categories

(Toolkit :: Crash Reporting, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(1 file)

In bug 1275780, we started collecting the panic string through a hook and storing it in a static. TO do this the data structure was added here:

http://searchfox.org/mozilla-central/source/toolkit/library/rust/shared/lib.rs#41

This type unnecessarily stores the length of the string twice. Like `&str`, `*const str` is a fat pointer containing both the address of the start of the string, and the length of the string, meaning that the second `usize` should be unnecessary.
MozReview-Commit-ID: rLOdMPxhwD
Attachment #8887132 - Flags: review?(ted)
Comment on attachment 8887132 [details] [diff] [review]
Stop storing panic string length twice

Review of attachment 8887132 [details] [diff] [review]:
-----------------------------------------------------------------

Oh, hah! I guess I was thinking in C terms there. :)
Attachment #8887132 - Flags: review?(ted) → review+
Pushed by michael@thelayzells.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4d0a260acd3f
Stop storing panic string length twice, r=ted
https://hg.mozilla.org/mozilla-central/rev/4d0a260acd3f
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.