Skip to content

Commit

Permalink
Use a different heap start for test_vm_layout_compressed_pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
qinsoon authored Oct 17, 2024
1 parent c24f92f commit dfe44e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/util/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ pub fn get_process_memory_maps() -> String {
data
}

/// Get the memory maps for the process. The returned string is a multi-line string.
/// This is only meant to be used for debugging. For example, log process memory maps after detecting a clash.
#[cfg(target_os = "macos")]
pub fn get_process_memory_maps() -> String {
// Get the current process ID (replace this with a specific PID if needed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ fn test_vm_layout_compressed_pointer() {
with_mockvm(
default_setup,
|| {
let start = 0x4000_0000;
let start = if cfg!(target_os = "macos") {
// Impossible to map 0x4000_0000 on maocOS. SO choose a different address.
0x60_0000_0000
} else {
0x4000_0000
};
let heap_size = 1024 * 1024;
let end = match start + heap_size {
end if end <= (4usize << 30) => 4usize << 30,
Expand Down

0 comments on commit dfe44e6

Please sign in to comment.