Skip to content

Commit ff028e1

Browse files
committed
fix:ch6 running ch5_spawn0, by moving buffer to heap
1 parent eee3ea9 commit ff028e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: os/src/fs/inode.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ impl OSInode {
4040
/// read all data from the inode
4141
pub fn read_all(&self) -> Vec<u8> {
4242
let mut inner = self.inner.exclusive_access();
43-
let mut buffer = [0u8; 512];
43+
let mut buffer: Vec<u8> = Vec::with_capacity(512);
44+
buffer.resize(512, 0);
4445
let mut v: Vec<u8> = Vec::new();
4546
loop {
4647
let len = inner.inode.read_at(inner.offset, &mut buffer);

0 commit comments

Comments
 (0)