Struct xpcom::AtomicRefcnt
[−]
[src]
pub struct AtomicRefcnt(_);
The type of the atomic reference count used for xpcom structs.
#[derive(xpcom)]
will use this type for the __refcnt
field when
#[refcnt = "atomic"]
is used.
See nsISupportsImpl.h
's ThreadSafeAutoRefCnt
class for reasoning behind
memory ordering decisions.
Methods
impl AtomicRefcnt
[src]
pub unsafe fn new() -> Self
[src]
Create a new reference count value. This is unsafe as manipulating Refcnt values is an easy footgun.
pub unsafe fn inc(&self) -> nsrefcnt
[src]
Increment the reference count. Returns the new reference count. This is unsafe as modifying this value can cause a use-after-free.
pub unsafe fn dec(&self) -> nsrefcnt
[src]
Decrement the reference count. Returns the new reference count. This is unsafe as modifying this value can cause a use-after-free.
pub fn get(&self) -> nsrefcnt
[src]
Get the current value of the reference count.