Closed
Bug 1381949
Opened 7 years ago
Closed 7 years ago
Expose functions for dealing Arc<Vec<u8>>
Categories
(Core :: Graphics: WebRender, enhancement)
Core
Graphics: WebRender
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: jrmuizel, Assigned: jrmuizel)
References
Details
Attachments
(1 file)
4.40 KB,
patch
|
rhunt
:
review+
|
Details | Diff | Splinter Review |
We'll need this for interacting with the font data from C++
Assignee | ||
Comment 1•7 years ago
|
||
Assignee: nobody → jmuizelaar
Attachment #8887616 -
Flags: review?(rhunt)
Comment 2•7 years ago
|
||
Comment on attachment 8887616 [details] [diff] [review] Expose functions for dealing with Arc<Vec<u8>> Review of attachment 8887616 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/webrender_bindings/src/bindings.rs @@ +1728,5 @@ > +pub type VecU8 = Vec<u8>; > +pub type ArcVecU8 = Arc<VecU8>; > + > +#[no_mangle] > +pub unsafe extern "C" fn wr_add_ref_arc(arc: &ArcVecU8) -> *const VecU8 { nit: The bindings file is all over the place on this, but I think we should be using *const instead of & in FFI function interfaces. They should codegen to be equivalent, but it emphasizes that the pointer might not follow rust's reference rules. @@ +1733,5 @@ > + Arc::into_raw(arc.clone()) > +} > + > +#[no_mangle] > +pub extern "C" fn wr_dec_ref_arc(arc: *const VecU8) { nit: you can annotate this function unsafe like the other one.
Attachment #8887616 -
Flags: review?(rhunt) → review+
Assignee | ||
Comment 3•7 years ago
|
||
(In reply to Ryan Hunt [:rhunt] from comment #2) > Comment on attachment 8887616 [details] [diff] [review] > Expose functions for dealing with Arc<Vec<u8>> > > Review of attachment 8887616 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: gfx/webrender_bindings/src/bindings.rs > @@ +1728,5 @@ > > +pub type VecU8 = Vec<u8>; > > +pub type ArcVecU8 = Arc<VecU8>; > > + > > +#[no_mangle] > > +pub unsafe extern "C" fn wr_add_ref_arc(arc: &ArcVecU8) -> *const VecU8 { > > nit: The bindings file is all over the place on this, but I think we should > be using *const instead of & in FFI function interfaces. > > They should codegen to be equivalent, but it emphasizes that the pointer > might not follow rust's reference rules. In this case I actually want the rust reference rules to be followed.
Comment 4•7 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #3) > (In reply to Ryan Hunt [:rhunt] from comment #2) > > Comment on attachment 8887616 [details] [diff] [review] > > Expose functions for dealing with Arc<Vec<u8>> > > > > Review of attachment 8887616 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > ::: gfx/webrender_bindings/src/bindings.rs > > @@ +1728,5 @@ > > > +pub type VecU8 = Vec<u8>; > > > +pub type ArcVecU8 = Arc<VecU8>; > > > + > > > +#[no_mangle] > > > +pub unsafe extern "C" fn wr_add_ref_arc(arc: &ArcVecU8) -> *const VecU8 { > > > > nit: The bindings file is all over the place on this, but I think we should > > be using *const instead of & in FFI function interfaces. > > > > They should codegen to be equivalent, but it emphasizes that the pointer > > might not follow rust's reference rules. > > In this case I actually want the rust reference rules to be followed. That's okay then. It won't be enforced on C/C++ code, but at the least it's written somewhere.
Pushed by jmuizelaar@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/8000ce443309 Expose functions for dealing Arc<Vec<u8>> r=rhunt
Comment 6•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8000ce443309
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in
before you can comment on or make changes to this bug.
Description
•