mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-18 20:16:42 +00:00
Make the allocated segment uninitialized in the ring buffer
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
e6f465b553
commit
5bc696a85a
@ -77,7 +77,10 @@ impl<T> RingBuffer<T> {
|
|||||||
"capacity must be a power of two"
|
"capacity must be a power of two"
|
||||||
);
|
);
|
||||||
let nframes = capacity.saturating_mul(Self::T_SIZE).align_up(PAGE_SIZE) / PAGE_SIZE;
|
let nframes = capacity.saturating_mul(Self::T_SIZE).align_up(PAGE_SIZE) / PAGE_SIZE;
|
||||||
let segment = FrameAllocOptions::new(nframes).alloc_contiguous().unwrap();
|
let segment = FrameAllocOptions::new(nframes)
|
||||||
|
.uninit(true)
|
||||||
|
.alloc_contiguous()
|
||||||
|
.unwrap();
|
||||||
Self {
|
Self {
|
||||||
segment,
|
segment,
|
||||||
capacity,
|
capacity,
|
||||||
|
Reference in New Issue
Block a user