Refine replace_mem_chunks to lock once
This commit is contained in:
parent
19104ed3e7
commit
9ee0a0ae73
@ -355,8 +355,9 @@ impl ProcessVM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn replace_mem_chunk(&self, old_chunk: &ChunkRef, new_chunk: ChunkRef) {
|
pub fn replace_mem_chunk(&self, old_chunk: &ChunkRef, new_chunk: ChunkRef) {
|
||||||
self.remove_mem_chunk(old_chunk);
|
let mut mem_chunks = self.mem_chunks.write().unwrap();
|
||||||
self.add_mem_chunk(new_chunk)
|
mem_chunks.remove(old_chunk);
|
||||||
|
mem_chunks.insert(new_chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try merging all connecting single VMAs of the process.
|
// Try merging all connecting single VMAs of the process.
|
||||||
|
Loading…
Reference in New Issue
Block a user