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§
- An atomically reference counted shared pointer
- A “borrowed
Arc
”. This is a pointer to a T that is known to have been allocated within anArc
. - A tagged union that can represent
Arc<A>
orArc<B>
while only consuming a single word. The type is alsoNonNull
, and thus can be stored in an Option without increasing size. - Structure to allow Arc-managing some fixed-sized data and a variably-sized slice in a single allocation.
- Header data with an inline length. Consumers that use HeaderWithLength as the Header type in HeaderSlice can take advantage of ThinArc.
- A “thin”
Arc
containing dynamically sized data - An
Arc
that is known to be uniquely owned
Enums§
- This represents a borrow of an
ArcUnion
.