mmtk/util/mod.rs
1//! Utilities used by other modules, including allocators, heap implementation, etc.
2
3// Allow unused code in the util mod. We may have some functions that are not in use,
4// but will be useful in future implementations.
5#![allow(dead_code)]
6
7// The following modules are public. MMTk bindings can use them to help implementation.
8
9/// An abstract of memory address and object reference.
10pub mod address;
11/// Allocators
12// This module is made public so the binding could implement allocator slowpaths if they would like to.
13pub mod alloc;
14/// Helpers for making native APIs.
15pub mod api_util;
16/// Constants used in MMTk
17pub mod constants;
18/// Calculation, conversion and rounding for memory related numbers.
19pub mod conversions;
20/// The copy allocators for a GC worker.
21pub mod copy;
22/// Heap implementation, including page resource, mmapper, etc.
23pub mod heap;
24/// Checking if an address is an valid MMTk object.
25#[cfg(feature = "vo_bit")]
26pub mod is_mmtk_object;
27/// Linear scan through a heap range
28pub mod linear_scan;
29/// Various malloc implementations (conditionally compiled by features)
30pub mod malloc;
31/// Memory utilities (non-OS dependent). OS dependent memory utilities can be found in [`crate::util::os::OSMemory`].
32pub mod memory;
33/// Metadata (OnSide or InHeader) implementation.
34pub mod metadata;
35/// Opaque pointers used in MMTk, e.g. VMThread.
36pub mod opaque_pointer;
37/// MMTk command line options.
38pub mod options;
39/// Operating system abstractions.
40pub mod os;
41#[cfg(feature = "test_private")]
42pub mod test_private;
43/// Test utilities. We need this module for `MockVM` in criterion benches, which does not include code with `cfg(test)`.
44#[cfg(any(test, feature = "mock_test"))]
45pub mod test_util;
46
47// The following modules are only public in the mmtk crate. They should only be used in MMTk core.
48/// An analysis framework for collecting data and profiling in GC.
49#[cfg(feature = "analysis")]
50pub(crate) mod analysis;
51pub(crate) mod epilogue;
52/// Non-generic refs to generic types of `<VM>`.
53pub(crate) mod erase_vm;
54/// Finalization implementation.
55pub(crate) mod finalizable_processor;
56/// Logger initialization
57pub(crate) mod logger;
58pub(crate) mod object_enum;
59/// Forwarding word in object copying.
60pub(crate) mod object_forwarding;
61/// Reference counting support.
62pub(crate) mod rc;
63/// Reference processing implementation.
64pub(crate) mod reference_processor;
65/// Utilities funcitons for Rust
66pub(crate) mod rust_util;
67/// Sanity checker for GC.
68#[cfg(feature = "sanity")]
69pub(crate) mod sanity;
70pub(crate) mod scanning_helper;
71/// Logging slots to check duplicated edges in GC.
72#[cfg(feature = "extreme_assertions")]
73pub(crate) mod slot_logger;
74/// Utils for collecting statistics.
75pub(crate) mod statistics;
76/// A treadmill implementation.
77pub(crate) mod treadmill;
78
79// These modules are private. They are only used by other util modules.
80
81/// A very simple, generic malloc-free allocator
82mod freelist;
83/// Implementation of GenericFreeList by an int vector.
84mod int_array_freelist;
85/// Implementation of GenericFreeList backed by raw memory, allocated
86/// on demand direct from the OS (via mmap).
87mod raw_memory_freelist;
88
89pub use self::address::Address;
90pub use self::address::ObjectReference;
91pub use self::opaque_pointer::*;