Skip to content

Commit 65109a6

Browse files
authored
Fix broken link in README, update porting guide on selecting plan (#349)
* Update porting guide on how to choose NoGC * Fix broken link in README
1 parent 5e9468d commit 65109a6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ For more information on these bindings, please visit their repositories.
6666

6767
MMTk provides a bi-directional interface with the language VM.
6868

69-
1. MMTk exposes a set of [APIs](src/mm/memory_manager.rs). The language VM can call into MMTk by using those APIs.
69+
1. MMTk exposes a set of [APIs](src/memory_manager.rs). The language VM can call into MMTk by using those APIs.
7070
2. MMTk provides a trait [`VMBinding`](src/vm/mod.rs) that each language VM must implement. MMTk use `VMBinding` to call into the VM.
7171

7272
To integrate MMTk with your language implementation, you need to provide an implementation of `VMBinding`, and

docs/portingguide/src/howto/nogc.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You may want to take the following steps.
1818
2. Change the VM build process to build and/or link MMTk
1919
- It may be easier to simply build a static and/or dynamic binary for MMTk and link it to the language directly, manually building new binaries as necessary.
2020
1. `cd binding_repo/mmtk`
21-
2. `cargo build --features nogc` to build in debug mode or add `--release` for release mode
21+
2. `cargo build` to build in debug mode or add `--release` for release mode
2222
3. Copy the shared or static library from `target/debug` or `target/release` to your desired location
2323
- Later, you can edit the language build process to build MMTk at the same time automatically.
2424
3. Replace VM allocation with calloc
@@ -27,6 +27,8 @@ You may want to take the following steps.
2727
4. Single Threaded MMTk Allocation
2828
1. Create a `mmtk.h` header file which exposes the functions required to implement NoGC (`gc_init`, `alloc`, `bind_mutator`), and `include` it. You can use the [DummyVM `mmtk.h` header file](https://github.com/mmtk/mmtk-core/blob/master/vmbindings/dummyvm/api/mmtk.h) as an example.
2929
2. Initialise MMTk by calling `gc_init`, with the size of the heap. In the future, you may wish to make this value configurable via a command line argument or environment variable.
30+
2. You can set [options for MMTk](https://www.mmtk.io/mmtk-core/mmtk/util/options/struct.Options.html) by using `process` to pass options, or simply by setting environtment variables. For example, to
31+
use the NoGC plan, you can set the env var `MMTK_PLAN=NoGC`.
3032
3. Create a MMTk mutator instance using `bind_mutator` and pass the return value of `gc_init`.
3133
4. Replace all previous `calloc` calls with `alloc` and optionally add a mutex around `alloc` if the VM is multi-threaded. The MMTk handle is the return value of the `bind_mutator` call.
3234
- In order to perform allocations, you will need to know what object alignment the VM expects. VMs often align allocations at word boundaries (e.g. 4 or 8 bytes) as it allows the CPU to access the data faster at runtime. Additionally, the language may use the unused lowest order bits to store flags (e.g. type information), so it is important that MMTk respects these expectations.

0 commit comments

Comments
 (0)