Closed Bug 1354950 Opened 8 years ago Closed 8 years ago

Add #[destructor_safe] attributes on functions that need it

Categories

(Core :: Graphics: WebRender, enhancement, P3)

Other Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file, 1 obsolete file)

The FFI binding generator has support for recognizing the #[destructor_safe] attribute on rust functions, and using [1] instead of [2] in the generated header. However we need to actually add these attributes to bindings.rs. I have a patch locally to do this. [1] http://searchfox.org/mozilla-central/rev/eace920a0372051a11d8d275bd9b8f14f3024ecd/gfx/webrender_bindings/webrender_ffi.h#471 [2] http://searchfox.org/mozilla-central/rev/eace920a0372051a11d8d275bd9b8f14f3024ecd/gfx/webrender_bindings/webrender_ffi.h#470
Attached patch Patch (obsolete) — Splinter Review
Comment on attachment 8856293 [details] [diff] [review] Patch Didn't know about #![feature(custom_attribute)], that's cool.
Attachment #8856293 - Flags: review?(rhunt) → review+
Hm, that's unfortunate. Another possibility would be to use doc comments [1][2] with a special identifier. Or hardcode a list that we pass to the binding generator. [1] https://doc.rust-lang.org/book/documentation.html#doc-attributes [2] https://dtolnay.github.io/syn/syn/struct.Attribute.html
Using a doc comment works great, thanks for the tip! Try push that includes the updated patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3e09ddc847aae07fe343ba03ebc55afe7b00da77
Attachment #8856293 - Attachment is obsolete: true
Attachment #8857214 - Flags: review?(rhunt) → review+
Pushed by kgupta@mozilla.com: https://hg.mozilla.org/projects/graphics/rev/14070c4d46fd Add a destructor_safe doc attribute as a hint to the binding generator. r=rhunt
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: