Closed Bug 1339218 Opened 8 years ago Closed 8 years ago

Re-introduce ns{Fixed,}{C,}StringRepr

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(1 file)

Unfortunately, we still need to have a representation of ns{Fixed,}{C,}StringRepr in tree, as some FFI structs need to control and run their destructors independently. Not providing a drop-implementation-free version of these types means that they are unusable in those situations, such as in the style bindings. This may be avoidable when `union` is stabilized in rust, as that will allow for structs which contain a value of a type to control whether or not that type's destructor gets run. (https://github.com/rust-lang/rust/issues/32836) This patch will pretty-much be a backout of bug 1316696.
MozReview-Commit-ID: 3VUWFA5tX1L
Attachment #8836901 - Flags: review?(nfroyd)
Comment on attachment 8836901 [details] [diff] [review] Re-introduce the ns[C]StringRepr type for use in bindings with custom destructor logic Review of attachment 8836901 [details] [diff] [review]: ----------------------------------------------------------------- rs=me on the presumption that this is a revert of the backout.
Attachment #8836901 - Flags: review?(nfroyd) → review+
Comment on attachment 8836901 [details] [diff] [review] Re-introduce the ns[C]StringRepr type for use in bindings with custom destructor logic This isn't exactly just a backout, as I still wanted ns[C]String to be `#[repr(C)]` which was also added in that patch, and I wanted to verify that both the ns[C]StringRepr and ns[C]String had the correct layout. I'd appreciate it if you could look over the changes a bit more closely :).
Attachment #8836901 - Flags: review+ → review?(nfroyd)
Comment on attachment 8836901 [details] [diff] [review] Re-introduce the ns[C]StringRepr type for use in bindings with custom destructor logic Review of attachment 8836901 [details] [diff] [review]: ----------------------------------------------------------------- ::: xpcom/rust/nsstring/src/lib.rs @@ +843,5 @@ > + align: *mut usize, > + offset: *mut usize) { > + unsafe { > + // Create a temporary value of type T to get offsets, sizes > + // and aligns off of I think "...and alignments from" reads better, WDYT?
Attachment #8836901 - Flags: review?(nfroyd) → review+
Pushed by michael@thelayzells.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/7ecbacf4e84c Re-introduce the ns[C]StringRepr type for use in bindings with custom destructor logic, r=froydnj
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: