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]

[src]

Create a new reference count value. This is unsafe as manipulating Refcnt values is an easy footgun.

[src]

Increment the reference count. Returns the new reference count. This is unsafe as modifying this value can cause a use-after-free.

[src]

Decrement the reference count. Returns the new reference count. This is unsafe as modifying this value can cause a use-after-free.

[src]

Get the current value of the reference count.

Trait Implementations

impl Debug for AtomicRefcnt
[src]

[src]

Formats the value using the given formatter. Read more