Commit 45a0f2db authored by Stefan Schindler's avatar Stefan Schindler
Browse files

Reduce buffer size because of rusts stack-overflow protection

parent 656bacf8
...@@ -22,7 +22,7 @@ lazy_static! { ...@@ -22,7 +22,7 @@ lazy_static! {
static ref HEADING: Style = Yellow.bold(); static ref HEADING: Style = Yellow.bold();
} }
const WRITE_BUFFER_SIZE: usize = 4 * 1024 * 1024; const WRITE_BUFFER_SIZE: usize = 4 * 1024;
fn main() { fn main() {
let model = get_file_contents("/sys/devices/virtual/dmi/id/product_version"); let model = get_file_contents("/sys/devices/virtual/dmi/id/product_version");
...@@ -383,7 +383,7 @@ fn whipe_disk(disk: &Arc<DiskInformation>) -> std::io::Result<std::time::Duratio ...@@ -383,7 +383,7 @@ fn whipe_disk(disk: &Arc<DiskInformation>) -> std::io::Result<std::time::Duratio
*disk.state.lock().unwrap() = Wiping{ progress: Byte(0), per_second: Byte(0) }; *disk.state.lock().unwrap() = Wiping{ progress: Byte(0), per_second: Byte(0) };
let mut buf = [0; WRITE_BUFFER_SIZE]; let mut buf = Box::new( [0; WRITE_BUFFER_SIZE] );
let mut position = Byte(0); let mut position = Byte(0);
let mut disk_file = std::fs::OpenOptions::new() let mut disk_file = std::fs::OpenOptions::new()
.write(true) .write(true)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment