mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 09:53:24 +00:00
Add uninit option for VmAllocOption
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
7304e06c88
commit
7803d9037e
@ -112,7 +112,8 @@ struct Page {
|
||||
impl Page {
|
||||
pub fn alloc() -> Result<Self> {
|
||||
let frame = {
|
||||
let vm_alloc_option = VmAllocOptions::new(1);
|
||||
let mut vm_alloc_option = VmAllocOptions::new(1);
|
||||
vm_alloc_option.uninit(true);
|
||||
let mut frames = VmFrameVec::allocate(&vm_alloc_option)?;
|
||||
frames.pop().unwrap()
|
||||
};
|
||||
@ -126,7 +127,6 @@ impl Page {
|
||||
let frame = {
|
||||
let vm_alloc_option = VmAllocOptions::new(1);
|
||||
let mut frames = VmFrameVec::allocate(&vm_alloc_option)?;
|
||||
frames.zero();
|
||||
frames.pop().unwrap()
|
||||
};
|
||||
Ok(Self {
|
||||
|
Reference in New Issue
Block a user