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 = "is_mmtk_object")]
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/// Wrapper functions for memory syscalls such as mmap, mprotect, etc.
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#[cfg(feature = "test_private")]
40pub mod test_private;
41/// Test utilities. We need this module for `MockVM` in criterion benches, which does not include code with `cfg(test)`.
42#[cfg(any(test, feature = "mock_test"))]
43pub mod test_util;
44
45// The following modules are only public in the mmtk crate. They should only be used in MMTk core.
46/// An analysis framework for collecting data and profiling in GC.
47#[cfg(feature = "analysis")]
48pub(crate) mod analysis;
49pub(crate) mod epilogue;
50/// Non-generic refs to generic types of `<VM>`.
51pub(crate) mod erase_vm;
52/// Finalization implementation.
53pub(crate) mod finalizable_processor;
54/// Logger initialization
55pub(crate) mod logger;
56pub(crate) mod object_enum;
57/// Forwarding word in object copying.
58pub(crate) mod object_forwarding;
59/// Reference processing implementation.
60pub(crate) mod reference_processor;
61/// Utilities funcitons for Rust
62pub(crate) mod rust_util;
63/// Sanity checker for GC.
64#[cfg(feature = "sanity")]
65pub(crate) mod sanity;
66/// Logging slots to check duplicated edges in GC.
67#[cfg(feature = "extreme_assertions")]
68pub(crate) mod slot_logger;
69/// Utils for collecting statistics.
70pub(crate) mod statistics;
71/// A treadmill implementation.
72pub(crate) mod treadmill;
73
74// These modules are private. They are only used by other util modules.
75
76/// A very simple, generic malloc-free allocator
77mod freelist;
78/// Implementation of GenericFreeList by an int vector.
79mod int_array_freelist;
80/// Implementation of GenericFreeList backed by raw memory, allocated
81/// on demand direct from the OS (via mmap).
82mod raw_memory_freelist;
83
84pub use self::address::Address;
85pub use self::address::ObjectReference;
86pub use self::opaque_pointer::*;