[pbs-devel] [PATCH v2 proxmox-backup 2/3] debug cli: add 'compare-content' flag to `diff archive` command

Lukas Wagner l.wagner at proxmox.com
Tue Dec 6 15:44:07 CET 2022


Hi,

On 12/6/22 12:39, Wolfgang Bumiller wrote:
>> +{
>> +    let mut buf_a = vec![0u8; BUFFERSIZE];
>> +    let mut buf_b = vec![0u8; BUFFERSIZE];
> 
> Maybe use a Box instead of a Vec, we don't ever resize this atm.
> 

Do you mean like this?
   let mut buf_a = Box::new([0u8; BUFFERSIZE]);

AFAIU this would construct the array on the stack first before it is moved into the Box,
leading to some unnecessary memcpys. Or am I missing something here?






More information about the pbs-devel mailing list