Use Vec instead of array to avoid 'stack overflow'
On debug build the worker thread stack overflows upon thread launch with default stack size even though the closure is only 130K. I don't know why this happens but moving the buffers to the heap solves the problem.
This commit is contained in:
parent
9ee21a0309
commit
616c0d4fa7
@ -123,8 +123,8 @@ struct VirtioNetDevice {
|
||||
rx: VirtQueue,
|
||||
tx: VirtQueue,
|
||||
rx_bytes: usize,
|
||||
rx_frame: [u8; MAX_BUFFER_SIZE],
|
||||
tx_frame: [u8; MAX_BUFFER_SIZE],
|
||||
rx_frame: Vec<u8>,
|
||||
tx_frame: Vec<u8>,
|
||||
}
|
||||
|
||||
impl VirtioNetDevice {
|
||||
@ -136,8 +136,8 @@ impl VirtioNetDevice {
|
||||
poll,
|
||||
tap_event_enabled: false,
|
||||
rx_bytes: 0,
|
||||
rx_frame: [0; MAX_BUFFER_SIZE],
|
||||
tx_frame: [0; MAX_BUFFER_SIZE],
|
||||
rx_frame: vec![0; MAX_BUFFER_SIZE],
|
||||
tx_frame: vec![0; MAX_BUFFER_SIZE],
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user