Panic reason string length is stored twice.

RESOLVED FIXED in Firefox 56

Status

()

defect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Nika, Assigned: Nika)

Tracking

unspecified
mozilla56
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment)

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: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.