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/// 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 processing implementation.
62pub(crate) mod reference_processor;
63/// Utilities funcitons for Rust
64pub(crate) mod rust_util;
65/// Sanity checker for GC.
66#[cfg(feature = "sanity")]
67pub(crate) mod sanity;
68/// Logging slots to check duplicated edges in GC.
69#[cfg(feature = "extreme_assertions")]
70pub(crate) mod slot_logger;
71/// Utils for collecting statistics.
72pub(crate) mod statistics;
73/// A treadmill implementation.
74pub(crate) mod treadmill;
75
76// These modules are private. They are only used by other util modules.
77
78/// A very simple, generic malloc-free allocator
79mod freelist;
80/// Implementation of GenericFreeList by an int vector.
81mod int_array_freelist;
82/// Implementation of GenericFreeList backed by raw memory, allocated
83/// on demand direct from the OS (via mmap).
84mod raw_memory_freelist;
85
86pub use self::address::Address;
87pub use self::address::ObjectReference;
88pub use self::opaque_pointer::*;