Add the "null" garbage collector
The null collector does not actually collect any garbage, it simply bump-allocates until the heap is exhausted, at which point further allocation attempts will fail. It does not require any GC barriers.
Users can configure which collector to use via the wasmtime::Config::collector method or the -C collector=drc|null CLI flag. The wasmtime::Collector enumeration, similar to the wasmtime::Strategy enumeration but for choosing a collector rather than a compiler, additionally has a table summarizing the properties and characteristics of our current set of collector implementations.
Finally, we also run .wast tests that exercise GC types under both the DRC and null collectors. I tried to avoid running tests that are not related to GC under both configurations just to avoid a combinatorial blow up.
Subscribe to Label Action
cc @fitzgen
Thus the following users have been cc'd because of the following labels:
- fitzgen: wasmtime:ref-types
To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.
Label Messager: wasmtime:config
It looks like you are changing Wasmtime's configuration options. Make sure to complete this check list:
-
[x] If you added a new
Configmethod, you wrote extensive documentation for it.Our documentation should be of the following form:
Short, simple summary sentence. More details. These details can be multiple paragraphs. There should be information about not just the method, but its parameters and results as well. Is this method fallible? If so, when can it return an error? Can this method panic? If so, when does it panic? # Example Optional example here. -
[x] If you added a new
Configmethod, or modified an existing one, you ensured that this configuration is exercised by the fuzz targets.For example, if you expose a new strategy for allocating the next instance slot inside the pooling allocator, you should ensure that at least one of our fuzz targets exercises that new strategy.
Often, all that is required of you is to ensure that there is a knob for this configuration option in
wasmtime_fuzzing::Config(or one of its nestedstructs).Rarely, this may require authoring a new fuzz target to specifically test this configuration. See our docs on fuzzing for more details.
-
[x] If you are enabling a configuration option by default, make sure that it has been fuzzed for at least two weeks before turning it on by default.
To modify this label's message, edit the .github/label-messager/wasmtime-config.md file.
To add new label messages or remove existing label messages, edit the
.github/label-messager.json configuration file.
Subscribe to Label Action
cc @fitzgen
Thus the following users have been cc'd because of the following labels:
- fitzgen: fuzzing
To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.
Very nice! I like how this shaped up.
Thanks!
I hope the
#[cfg]wasn't too much to add, but it all looks relatively focused to be so it's hopefully just a one-time cost.
Indeed, it was mostly some shuffling to get rid of the disabled collector impl and then realizing that various things that were DRC-specific modules could actually be made a little more generic and reused with other collectors. I think adding the copying collector will be relatively small in comparison to this PR, which is kind of funny.