Cargo Features

zerogc-simple = { version = "0.2.0-alpha.7", default-features = false, features = ["small-object-arenas", "implicit-grey-stack", "sync", "multiple-collectors"] }
default = multiple-collectors, small-object-arenas, sync

These default features are set whenever zerogc-simple is added without default-features = false somewhere in the dependency tree.

small-object-arenas default = once_cell

Use very fast dedicated arenas for small objects.
This makes allocation much faster
Time spent in malloc (even in heavy workloads) drops to near zero This can also improve memory significantly by avoiding per-object overheads
However, it increases code complexity and is more
agressive (memory wise) then delegating all work to std::alloc TODO: Return unused memory to the operating systems TODO: Thread-local caching (make arenas fast again)


Use recursion to implicitly track the grey stack
This risks stack overflow at a possible performance gain See commit 9a9634d68a4933d

sync default = parking_lot

Allow multiple threads to access the garbage collector by creating a seperate context for each.

This can increase overhead by requiring communication between threads.

Enables sync of zerogc-context

Shared impl

multiple-collectors default

Allow multiple collectors to exist at once
Otherwise, there's a single global collector (useful in VMs)

Even if multiple collectors are enabled, pointers from one collector can't be safely mixed with other collectors.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

once_cell small-object-arenas
parking_lot sync

Enables parking_lot ^0.11