Skip to content

Commit

Permalink
Removing references to enable_collection and disable_collection
Browse files Browse the repository at this point in the history
  • Loading branch information
udesou committed Jan 29, 2024
1 parent 496eb2f commit 4797c8e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
5 changes: 2 additions & 3 deletions benches/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ use mmtk::util::test_util::fixtures::*;
use mmtk::AllocationSemantics;

pub fn bench(c: &mut Criterion) {
// Disable GC so we won't trigger GC
let mut fixture = MutatorFixture::create_with_heapsize(1 << 30);
memory_manager::disable_collection(fixture.mmtk());
// Setting a larger heap so we won't trigger GC, but we should disable GC if we can
let mut fixture = MutatorFixture::create_with_heapsize(1 << 60);
c.bench_function("alloc", |b| {
b.iter(|| {
let _addr =
Expand Down
6 changes: 0 additions & 6 deletions docs/header/mmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ extern void mmtk_flush_mutator(MMTk_Mutator mutator);
// Initialize MMTk scheduler and GC workers
extern void mmtk_initialize_collection(void* tls);

// Allow MMTk to perform a GC when the heap is full
extern void mmtk_enable_collection();

// Disallow MMTk to perform a GC when the heap is full
extern void mmtk_disable_collection();

// Allocate memory for an object
extern void* mmtk_alloc(MMTk_Mutator mutator,
size_t size,
Expand Down
5 changes: 2 additions & 3 deletions src/memory_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ use std::sync::atomic::Ordering;
/// 2. Set command line options for MMTKBuilder by [`crate::memory_manager::process`] or [`crate::memory_manager::process_bulk`].
/// 3. Initialize MMTk by calling this function, `mmtk_init()`, and pass the builder earlier. This call will return an MMTK instance.
/// Usually a binding store the MMTK instance statically as a singleton. We plan to allow multiple instances, but this is not yet fully
/// supported. Currently we assume a binding will only need one MMTk instance.
/// 4. Enable garbage collection in MMTk by [`crate::memory_manager::enable_collection`]. A binding should only call this once its
/// thread system is ready. MMTk will not trigger garbage collection before this call.
/// supported. Currently we assume a binding will only need one MMTk instance. Note that GC is enabled by default and the binding should
/// implement `VMCollection::is_collection_disabled()` if it requires that the GC should be disabled at a particular time.
///
/// Note that this method will attempt to initialize a logger. If the VM would like to use its own logger, it should initialize the logger before calling this method.
/// Note that, to allow MMTk to do GC properly, `initialize_collection()` needs to be called after this call when
Expand Down

0 comments on commit 4797c8e

Please sign in to comment.