rc
12 items · generated by scribe fromstdlib/rc.fd· synced 2026-11-15
Contents
- Rc (struct)
- rc_new (function)
- rc_clone (function)
- rc_get (function)
- rc_count (function)
- rc_drop (function)
- Arc (struct)
- arc_new (function)
- arc_clone (function)
- arc_get (function)
- arc_count (function)
- arc_drop (function)
Rc
Rc: single-threaded reference counted pointer. count_addr points to the reference count (i64) on the heap. value is the wrapped value (i64 / opaque pointer).
pub struct Rc {Fields:
| Name | Type |
|---|---|
count_addr | i64 |
value | i64 |
Defined at line 33
rc_new
Create a new Rc wrapping a value.
pub fn rc_new(val: i64) -> Rc {Parameters:
val:i64
Returns: Rc
Defined at line 39
rc_clone
Clone an Rc: increments the refcount and returns a copy.
pub fn rc_clone(r: Rc) -> Rc {Parameters:
r:Rc
Returns: Rc
Defined at line 48
rc_get
Get the wrapped value without affecting the refcount.
pub fn rc_get(r: Rc) -> i64 {Parameters:
r:Rc
Returns: i64
Defined at line 56
rc_count
Get the current refcount.
pub fn rc_count(r: Rc) -> i64 {Parameters:
r:Rc
Returns: i64
Defined at line 61
rc_drop
Drop an Rc: decrements the refcount. When it hits 0, frees the counter.
pub fn rc_drop(r: Rc) -> void {Parameters:
r:Rc
Returns: void
Defined at line 66
Arc
Arc: atomically reference counted pointer (thread-safe).
pub struct Arc {Fields:
| Name | Type |
|---|---|
count_addr | i64 |
value | i64 |
Defined at line 76
arc_new
Create a new Arc wrapping a value.
pub fn arc_new(val: i64) -> Arc {Parameters:
val:i64
Returns: Arc
Defined at line 82
arc_clone
Clone an Arc: atomically increments the refcount.
pub fn arc_clone(a: Arc) -> Arc {Parameters:
a:Arc
Returns: Arc
Defined at line 91
arc_get
Get the wrapped value without affecting the refcount.
pub fn arc_get(a: Arc) -> i64 {Parameters:
a:Arc
Returns: i64
Defined at line 99
arc_count
Get the current refcount (atomic load).
pub fn arc_count(a: Arc) -> i64 {Parameters:
a:Arc
Returns: i64
Defined at line 104
arc_drop
Drop an Arc: atomically decrements the refcount. When it hits 0, frees.
pub fn arc_drop(a: Arc) -> void {Parameters:
a:Arc
Returns: void
Defined at line 109
Generated by scribe, the Fides documentation generator