Skip to content

Commit ff401f9

Browse files
authored
Use MMTK VM space (mmtk#56)
Merge with mmtk/mmtk-core#802 and mmtk/julia#12
1 parent 96ef821 commit ff401f9

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

mmtk/Cargo.lock

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mmtk/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2018"
1010
[package.metadata.julia]
1111
# Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works.
1212
julia_repo = "https://github.com/mmtk/julia.git"
13-
julia_version = "95bc54ab673fcdf11604324638f597f32158a22f"
13+
julia_version = "eb407eb68ea976df72c8e1cd6ec8607ff8d98fa5"
1414

1515
[lib]
1616
crate-type = ["staticlib", "rlib", "dylib"]
@@ -29,7 +29,7 @@ lazy_static = "1.1"
2929
# - change branch
3030
# - change repo name
3131
# But other changes including adding/removing whitespaces in commented lines may break the CI.
32-
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "ed347f19f230dfec8c05a24032f1529e9079478c" }
32+
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "e309f9351dff9cd0c8f3f590002c6edafd158c82" }
3333
# Uncomment the following to build locally
3434
# mmtk = { path = "../repos/mmtk-core" }
3535
log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] }
@@ -46,7 +46,7 @@ semispace = []
4646
gencopy = []
4747
pageprotect = []
4848
malloc_counted_size = ["mmtk/malloc_counted_size"]
49-
immix = ["malloc_counted_size", "mmtk/immix_non_moving", "mmtk/immix_smaller_block", "scan_obj_c"]
49+
immix = ["malloc_counted_size", "mmtk/immix_non_moving", "mmtk/immix_smaller_block", "scan_obj_c", "mmtk/vm_space"]
5050
marksweep = ["malloc_counted_size", "scan_obj_c"]
5151
# FIXME update and use rust object scanner as default for immix
5252
scan_obj_c = []

mmtk/api/mmtk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ extern void modify_check(void* ref);
5757
extern int object_is_managed_by_mmtk(void* addr);
5858
extern void runtime_panic(void);
5959

60+
extern void mmtk_set_vm_space(void* addr, size_t size);
61+
6062
// Write barriers
6163
extern void mmtk_memory_region_copy(MMTk_Mutator mutator, void* src_obj, void* src_addr, void* dst_obj, void* dst_addr, size_t size);
6264
extern void mmtk_object_reference_write_post(MMTk_Mutator mutator, const void* src, const void* target);

mmtk/src/api.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,14 @@ pub extern "C" fn runtime_panic() {
447447
panic!("Panicking at runtime!")
448448
}
449449

450+
#[no_mangle]
451+
#[allow(mutable_transmutes)]
452+
pub extern "C" fn mmtk_set_vm_space(start: Address, size: usize) {
453+
let mmtk: &mmtk::MMTK<JuliaVM> = &SINGLETON;
454+
let mmtk_mut: &mut mmtk::MMTK<JuliaVM> = unsafe { std::mem::transmute(mmtk) };
455+
memory_manager::lazy_init_vm_space(mmtk_mut, start, size);
456+
}
457+
450458
#[no_mangle]
451459
pub extern "C" fn mmtk_memory_region_copy(
452460
mutator: *mut Mutator<JuliaVM>,

0 commit comments

Comments
 (0)