Struct xpcom::Refcnt
[−]
[src]
pub struct Refcnt(_);
The type of the reference count type for xpcom structs.
#[derive(xpcom)]
will use this type for the __refcnt
field when
#[refcnt = "nonatomic"]
is used.
Methods
impl Refcnt
[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.