mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Rejigger a bit rust features so that rusttests still link.
We cannot compile with just feature(gecko + debug_assertions), since that's how debug rusttests get compiled and they don't have the refcount logging stuff. We were getting away with it for the pre-existing usage of the style crate, because it wasn't used during any test and presumably the linker didn't complain. But servo_arc is definitely used in tests. Differential Revision: https://phabricator.services.mozilla.com/D32691
This commit is contained in:
parent
9a9a4e12d5
commit
3652a0f1e1
4 changed files with 9 additions and 8 deletions
|
@ -177,7 +177,7 @@ impl<T> Arc<T> {
|
|||
data,
|
||||
}));
|
||||
|
||||
#[cfg(all(feature = "gecko", debug_assertions))]
|
||||
#[cfg(feature = "gecko_refcount_logging")]
|
||||
unsafe {
|
||||
// FIXME(emilio): Would be so amazing to have
|
||||
// std::intrinsics::type_name() around, so that we could also report
|
||||
|
@ -312,7 +312,7 @@ impl<T: ?Sized> Arc<T> {
|
|||
|
||||
#[inline(always)]
|
||||
fn record_drop(&self) {
|
||||
#[cfg(all(feature = "gecko", debug_assertions))]
|
||||
#[cfg(feature = "gecko_refcount_logging")]
|
||||
unsafe {
|
||||
NS_LogDtor(self.ptr() as *const _, b"ServoArc\0".as_ptr() as *const _, 8);
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ impl<T: ?Sized> Arc<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "gecko", debug_assertions))]
|
||||
#[cfg(feature = "gecko_refcount_logging")]
|
||||
extern "C" {
|
||||
fn NS_LogCtor(aPtr: *const std::os::raw::c_void, aTypeName: *const std::os::raw::c_char, aSize: u32);
|
||||
fn NS_LogDtor(aPtr: *const std::os::raw::c_void, aTypeName: *const std::os::raw::c_char, aSize: u32);
|
||||
|
@ -745,7 +745,7 @@ impl<H, T> Arc<HeaderSlice<H, [T]>> {
|
|||
);
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "gecko", debug_assertions))]
|
||||
#[cfg(feature = "gecko_refcount_logging")]
|
||||
unsafe {
|
||||
if !is_static {
|
||||
// FIXME(emilio): Would be so amazing to have
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue