You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This implements the current garbage collector in Rust. No changes were made to
the GC design -- it's just ports the one implemented in code generator to Rust.
The goals are:
- Evaluate Rust for Motoko's RTS implementation
- Make the collector easier to read, understand, modify, and extend.
Currently passes the tests locally. We can't run this branch on CI yet as it
needs to download rustc nightly and xargo and the domains are not allowed on the
CI. I think in the final version we'll have to build rustc outselves instead of
downloading.
(Nightly rustc is needed as "core" distributed with rustc is not built with PIC
relocation model on wam32, so we can't use it to generate a shared wasm32
library)
Main changes:
- New Rust crate "motoko-rts" introduced, which currently implements the
garbage collector. It also has some utilities for printing the heap or
individual objects, to be used when debugging.
- Nix files updated to download rustc and xargo. These are used to build Rust's
"core" library with PIC relocation model for wasm32.
- We no longer build memset and memcpy of musl as those are provided by Rust's
"core" now.
The main algorithm is in `gc.rs`. Rest of the Rust files are helpers, mainly for
debugging.
Other changes:
- I had to update lots of ic-ref-run outputs. See #1854 for the details.
Remaining work and issues:
- There's currently a bug somewhere that causes random failures as I move the
code around. One example of this is in the last line of `gc.rs` where I have a
no-op function call `dump_heap()` which when removed causes the test "life" to
fail with a trap.
- Figure out how to use rustc nightly (with PIC wasm32 libraries) in CI.
0 commit comments