style: Share computed and specified value representation of -moz-context-properties.

Differential Revision: https://phabricator.services.mozilla.com/D30545
This commit is contained in:
Emilio Cobos Álvarez 2019-05-16 23:03:29 +00:00
parent 2bc4c42d45
commit bbc77e3977
6 changed files with 89 additions and 70 deletions

View file

@ -85,6 +85,16 @@ impl<T> ArcSlice<T> {
mem::forget(self);
ret
}
/// Leaks an empty arc slice pointer, and returns it. Only to be used to
/// construct ArcSlices from FFI.
#[inline]
pub fn leaked_empty_ptr() -> *mut std::os::raw::c_void {
let empty: ArcSlice<_> = EMPTY_ARC_SLICE.clone();
let ptr = empty.0.ptr();
std::mem::forget(empty);
ptr as *mut _
}
}
/// The inner pointer of an ArcSlice<T>, to be sent via FFI.