aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo_arc
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2023-05-11 00:36:24 +0000
committerMartin Robinson <mrobinson@igalia.com>2023-11-24 08:57:14 +0100
commit779aa9d30ec43c043910883dce5988c0b01534bd (patch)
tree89b742d8c798da48e62ed721405a8a9e66c6b890 /components/servo_arc
parentd9d865e8c9fad5eaaa15be7d3bfbf53df47135ca (diff)
downloadservo-779aa9d30ec43c043910883dce5988c0b01534bd.tar.gz
servo-779aa9d30ec43c043910883dce5988c0b01534bd.zip
style: Remove HasArcFFI for some types
See blocked bug. For non-Locked types we can just use the same underlying type at the FFI boundary. Port StylesheetContents and CssUrlData to this set-up. CssUrlData is already generated by cbindgen anyways. Differential Revision: https://phabricator.services.mozilla.com/D177559
Diffstat (limited to 'components/servo_arc')
-rw-r--r--components/servo_arc/lib.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs
index 24d79cef68a..4184dc95282 100644
--- a/components/servo_arc/lib.rs
+++ b/components/servo_arc/lib.rs
@@ -221,7 +221,7 @@ impl<T> Arc<T> {
///
/// It is recommended to use RawOffsetArc for this.
#[inline]
- fn into_raw(this: Self) -> *const T {
+ pub fn into_raw(this: Self) -> *const T {
let ptr = unsafe { &((*this.ptr()).data) as *const _ };
mem::forget(this);
ptr
@@ -231,10 +231,8 @@ impl<T> Arc<T> {
///
/// Note: This raw pointer will be offset in the allocation and must be preceded
/// by the atomic count.
- ///
- /// It is recommended to use RawOffsetArc for this
#[inline]
- unsafe fn from_raw(ptr: *const T) -> Self {
+ pub unsafe fn from_raw(ptr: *const T) -> Self {
// To find the corresponding pointer to the `ArcInner` we need
// to subtract the offset of the `data` field from the pointer.
let ptr = (ptr as *const u8).sub(data_offset::<T>());