Skip to content

Commit 3a5b86e

Browse files
committedFeb 17, 2025·
fix:ch6 running ch5_spawn0, by moving buffer to heap
1 parent e60d427 commit 3a5b86e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎os/src/fs/inode.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ impl OSInode {
3434
pub fn read_all(&self) -> Vec<u8> {
3535
trace!("kernel: OSInode::read_all");
3636
let mut inner = self.inner.exclusive_access();
37-
let mut buffer = [0u8; 512];
37+
let mut buffer: Vec<u8> = Vec::with_capacity(512);
38+
buffer.resize(512, 0);
3839
let mut v: Vec<u8> = Vec::new();
3940
loop {
4041
let len = inner.inode.read_at(inner.offset, &mut buffer);

0 commit comments

Comments
 (0)
Please sign in to comment.