13 releases (2 stable)

new 2.0.0 Dec 2, 2024
1.0.0 Oct 12, 2024
0.1.10 Oct 10, 2024
0.1.8 Jul 21, 2024

#165 in Programming languages

Download history 9039/week @ 2024-08-16 9527/week @ 2024-08-23 10242/week @ 2024-08-30 10481/week @ 2024-09-06 9900/week @ 2024-09-13 12991/week @ 2024-09-20 13881/week @ 2024-09-27 23408/week @ 2024-10-04 39634/week @ 2024-10-11 40344/week @ 2024-10-18 39884/week @ 2024-10-25 43447/week @ 2024-11-01 43639/week @ 2024-11-08 47824/week @ 2024-11-15 48067/week @ 2024-11-22 47892/week @ 2024-11-29

195,363 downloads per month
Used in 213 crates (8 directly)

Apache-2.0

49KB
1K SLoC

Allocator for swc.

Features

  • scoped: Enable scoped 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.

Dependencies

~4.5MB
~78K SLoC