Expand description
Allocator for swc.
§Features
scoped
: Enablescoped
mode.
§Modes
§Default mode
In default mode, crate::boxed::Box and crate::vec::Vec are identical to the original types in std.
§Scoped mode
- You need to enable
scoped
feature to use this mode.
In scoped
mode you can use FastAlloc to make crate::boxed::Box and
crate::vec::Vec very fast.
In this mode, you need to be careful while using crate::boxed::Box and crate::vec::Vec. You should ensure that Allocator outlives all crate::boxed::Box and crate::vec::Vec created in the scope.
Recommened way to use this mode is to wrap the whole operations in a call to [Allocator::scope].
Modules§
- Faster box type.
- Various collections.
- Box
and Vec depeding on the feature. - Faster vec type.
Macros§
- Usage:
swc_allocator::Type!(Vec<T>)
orswc_allocator::Type!(Box<T>)
. - This expands to the given tokens if the
nightly
feature is enabled.
Structs§
- The actual storage for FastAlloc.
- Fast allocator, effectively working as a cache.