-
Notifications
You must be signed in to change notification settings - Fork 69
/
Cargo.toml
207 lines (169 loc) · 7.52 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
[package]
name = "mmtk"
version = "0.29.0"
authors = ["The MMTk Developers <>"]
edition = "2021"
license = "MIT OR Apache-2.0"
description = "MMTk is a framework for the design and implementation of high-performance and portable memory managers."
homepage = "https://www.mmtk.io"
repository = "https://github.com/mmtk/mmtk-core"
readme = "README.md"
categories = ["memory-management"]
keywords = ["gc", "garbage", "collection", "garbage-collection", "allocation"]
rust-version = "1.71.1"
build = "build.rs"
[lib]
name = "mmtk"
crate-type = ["rlib"]
doctest = false
[dependencies]
atomic = "0.6.0"
atomic_refcell = "0.1.7"
atomic-traits = "0.4.0"
bytemuck = { version = "1.14.0", features = ["derive"] }
cfg-if = "1.0"
crossbeam = "0.8.1"
delegate = "0.12.0"
downcast-rs = "1.1.1"
enum-map = "2.4.2"
env_logger = { version = "0.11.3", optional = true }
is-terminal = "0.4.7"
itertools = "0.12.0"
jemalloc-sys = { version = "0.5.3", features = ["disable_initial_exec_tls"], optional = true }
lazy_static = "1.1"
libc = "0.2"
log = { version = "0.4", features = ["max_level_trace", "release_max_level_off"] }
memoffset = "0.9"
mimalloc-sys = { version = "0.1.6", optional = true }
# MMTk macros - we have to specify a version here in order to publish the crate, even though we use the dependency from a local path.
mmtk-macros = { version="0.29.0", path = "macros/" }
num_cpus = "1.8"
num-traits = "0.2"
pfm = { version = "0.1.1", optional = true }
portable-atomic = "1.4.3"
probe = "0.5"
regex = "1.7.0"
rustversion = "1.0"
spin = "0.9.5"
static_assertions = "1.1.0"
strum = "0.26.2"
strum_macros = "0.26.2"
sysinfo = "0.30.9"
[dev-dependencies]
paste = "1.0.8"
rand = "0.8.5"
rand_chacha = "0.3.1"
criterion = "0.4"
[build-dependencies]
built = { version = "0.7.1", features = ["git2"] }
[[bench]]
name = "main"
harness = false
[features]
default = ["builtin_env_logger"]
# Built-in env_logger. This feature is enabled by default.
# The user can disable this default feature to remove `env_logger` from the dependencies.
# See `crate::util::logger` for more details.
builtin_env_logger = ["dep:env_logger"]
# Enable this feature if you want to use nightly features and compiler
nightly = []
# This feature is only supported on x86-64 for now
# It's manually added to CI scripts
perf_counter = ["dep:pfm"]
# This feature is only used for tests with MockVM.
# CI scripts run those tests with this feature.
mock_test = ["test_private"]
# This feature will expose some private functions for testings or benchmarking.
test_private = []
# .github/scripts/ci-common.sh extracts features from the following part (including from comments).
# So be careful when editing or adding stuff to the section below.
# Do not modify the following line - ci-common.sh matches it
# -- Non mutually exclusive features --
# spaces with different semantics
# A VM-allocated/managed space. A binding could use this for their boot image, metadata space, etc.
# FIXME: This is not properly implemented yet (it is only working for JikesRVM): https://github.com/mmtk/mmtk-core/issues/415
# If a binding would need to trace/scan objects that is allocated and managed by the VM, `ActivePlan::vm_trace_object()` is an alternative.
vm_space = []
# Bulk set unlog bits for all objects inside the VM space. A binding can use
# this in case they do not have a way to iterate through objects in the
# bootimage to set the unlog bit. Note that this will set the unlog bit for
# addresses that may not correspond to valid objects.
set_unlog_bits_vm_space = []
# A readonly space.
# TODO: This is not properly implemented yet. We currently use an immortal space instead, and do not guarantee read-only semantics.
ro_space = []
# A code space with execution permission.
code_space = []
# By default, we only allow execution permission for code spaces. With this feature, all the spaces have execution permission.
# Use with care.
exec_permission_on_all_spaces = []
# Global valid object (VO) bit metadata.
# The VO bit is set when an object is allocated, and cleared when the GC determines it is dead.
# See `src/util/metadata/vo_bit/mod.rs`
#
# eager_sweeping: VO bits for dead objects must have been cleared by the end of each GC.
# Native MarkSweep only ensures this in eager sweeping mode.
vo_bit = ["eager_sweeping"]
# conservative garbage collection support
is_mmtk_object = ["vo_bit"]
# Enable object pinning, in particular, enable pinning/unpinning, and its metadata
object_pinning = []
# The following two features are useful for using Immix for VMs that do not support moving GC.
# Disable any object copying in Immix. This makes Immix a non-moving policy.
immix_non_moving = []
# Disable any object copying in nursery GC for Sticky Immix while allowing other kinds of copying.
# `immix_non_moving` disables all kinds of copying in Immix, so this feature is not needed
# if `immix_non_moving` is in use.
sticky_immix_non_moving_nursery = []
# Turn on stress copying for Immix. This is a debug feature to test copying for Immix plans.
immix_stress_copying = []
# Reduce block size for ImmixSpace. This mitigates fragmentation when defrag is disabled.
immix_smaller_block = []
# Zero the unmarked lines after a GC cycle in immix. This helps debug untraced objects.
immix_zero_on_release = []
# Run sanity GC
sanity = []
# Run analysis
analysis = []
# Use lock free variant of NoGC
nogc_lock_free = []
# Use lock free with no zeroing NoGC
nogc_no_zeroing = ["nogc_lock_free"]
# For using a single GC thread
# Q: Why do we need this as a compile time flat? We can always set the number of GC threads through options.
single_worker = []
# To run expensive comprehensive runtime checks, such as checking duplicate edges
extreme_assertions = []
# Enable multiple spaces for NoGC, each allocator maps to an individual ImmortalSpace.
nogc_multi_space = []
# To collect statistics for each GC work packet. Enabling this may introduce a small overhead (several percentage slowdown on benchmark time).
work_packet_stats = []
# Count the malloc'd memory into the heap size
malloc_counted_size = []
# Count the size of all live objects in GC
count_live_bytes_in_gc = []
# Workaround a problem where bpftrace scripts (see tools/tracing/timeline/capture.bt) cannot
# capture the type names of work packets.
bpftrace_workaround = []
# Do not modify the following line - ci-common.sh matches it
# -- Mutally exclusive features --
# Only one feature from each group can be provided. Otherwise build will fail.
# Name of the mutualy exclusive feature group. ci-common.sh matches lines like this one.
# Group:malloc
# only one of the following features should be enabled, or none to use the default malloc from libc
# this does not replace the global Rust allocator, but provides these libraries for GC implementation
malloc_mimalloc = ["dep:mimalloc-sys"]
malloc_jemalloc = ["dep:jemalloc-sys"]
# Use the native mimalloc allocator for malloc. This is not tested by me (Yi) yet, and it is only used to make sure that some code
# is not compiled in default builds.
malloc_native_mimalloc = []
# If there are more groups, they should be inserted above this line
# Group:end
# Group:marksweepallocation
# default is native allocator with lazy sweeping
eager_sweeping = []
# Use library malloc as the freelist allocator for mark sweep. This will makes mark sweep slower. As malloc may return addresses outside our
# normal heap range, we will have to use chunk-based SFT table. Turning on this feature will use a different SFT map implementation on 64bits,
# and will affect all the plans in the build. Please be aware of the consequence, and this is only meant to be experimental use.
malloc_mark_sweep = []
# Group:end