mmtk/
lib.rs

1// Use the `{likely, unlikely}` provided by compiler when using nightly
2#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
3
4//! Memory Management ToolKit (MMTk) is a portable and high performance memory manager
5//! that includes various garbage collection algorithms and provides clean and efficient
6//! interfaces to cooperate with language implementations. MMTk features highly modular
7//! and highly reusable designs. It includes components such as allocators, spaces and
8//! work packets that GC implementers can choose from to compose their own GC plan easily.
9//!
10//! Logically, this crate includes these major parts:
11//! * GC components:
12//!   * [Allocators](util/alloc/allocator/trait.Allocator.html): handlers of allocation requests which allocate objects to the bound space.
13//!   * [Policies](policy/space/trait.Space.html): definitions of semantics and behaviors for memory regions.
14//!     Each space is an instance of a policy, and takes up a unique proportion of the heap.
15//!   * [Work packets](scheduler/work/trait.GCWork.html): units of GC work scheduled by the MMTk's scheduler.
16//! * [GC plans](plan/global/trait.Plan.html): GC algorithms composed from components.
17//! * [Heap implementations](util/heap/index.html): the underlying implementations of memory resources that support spaces.
18//! * [Scheduler](scheduler/scheduler/struct.GCWorkScheduler.html): the MMTk scheduler to allow flexible and parallel execution of GC work.
19//! * Interfaces: bi-directional interfaces between MMTk and language implementations
20//!   i.e. [the memory manager API](memory_manager/index.html) that allows a language's memory manager to use MMTk
21//!   and [the VMBinding trait](vm/trait.VMBinding.html) that allows MMTk to call the language implementation.
22
23#[macro_use]
24extern crate lazy_static;
25#[macro_use]
26extern crate log;
27#[macro_use]
28extern crate downcast_rs;
29#[macro_use]
30extern crate static_assertions;
31#[macro_use]
32extern crate probe;
33
34mod mmtk;
35pub use mmtk::MMTKBuilder;
36pub(crate) use mmtk::MMAPPER;
37pub use mmtk::MMTK;
38
39mod global_state;
40pub use crate::global_state::LiveBytesStats;
41
42mod policy;
43
44pub mod build_info;
45pub mod memory_manager;
46pub mod plan;
47pub mod scheduler;
48pub mod util;
49pub mod vm;
50
51pub use crate::plan::{
52    AllocationSemantics, BarrierSelector, Mutator, MutatorContext, ObjectQueue, Plan,
53};