mirror of
https://github.com/servo/servo.git
synced 2025-08-24 06:45:33 +01:00
style: Make the counters non-atomic counters and merge afterwards.
This was consistently faster in the benchmark (even when counters were disabled, which was slightly suspicious, but...). Anyway, it's not really much code, most of it is FFI copy-pasta. Differential Revision: https://phabricator.services.mozilla.com/D3874
This commit is contained in:
parent
4f04988c13
commit
86b4b70369
3 changed files with 45 additions and 11 deletions
|
@ -305,6 +305,15 @@ pub struct OwnedOrNull<GeckoType> {
|
|||
}
|
||||
|
||||
impl<GeckoType> OwnedOrNull<GeckoType> {
|
||||
/// Returns a null pointer.
|
||||
#[inline]
|
||||
pub fn null() -> Self {
|
||||
Self {
|
||||
ptr: ptr::null_mut(),
|
||||
_marker: PhantomData,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns whether this pointer is null.
|
||||
#[inline]
|
||||
pub fn is_null(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue