Crate servo_arc

Source
Expand description

Fork of Arc for Servo. This has the following advantages over std::sync::Arc:

  • We don’t waste storage on the weak reference count.
  • We don’t do extra RMU operations to handle the possibility of weak references.
  • We can experiment with arena allocation (todo).
  • We can add methods to support our custom use cases 1.
  • We have support for dynamically-sized types (see from_header_and_iter).
  • We have support for thin arcs to unsized types (see ThinArc).
  • We have support for references to static data, which don’t do any refcounting.

Structs§

Arc
An atomically reference counted shared pointer
ArcBorrow
A “borrowed Arc”. This is a pointer to a T that is known to have been allocated within an Arc.
ArcUnion
A tagged union that can represent Arc<A> or Arc<B> while only consuming a single word. The type is also NonNull, and thus can be stored in an Option without increasing size.
HeaderSlice
Structure to allow Arc-managing some fixed-sized data and a variably-sized slice in a single allocation.
UniqueArc
An Arc that is known to be uniquely owned

Enums§

ArcUnionBorrow
This represents a borrow of an ArcUnion.

Type Aliases§

ThinArc
This is functionally equivalent to Arc<(H, [T])>
ThinArcUnion
See ArcUnion. This is a version that works for ThinArcs.