You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you sure it's allocating 256 KiB? My reading of that code is that it's doing what it says. (Specifically, that the type of the array elements are inferred to be u8 based on the call to read().)
I'm wrong! Yesterday I instrumented your code (what I should have done first) and saw it actually IS 64KiB.
I filed the issue after writing a test program that shows it's 256KiB... But I didn't realize Rust backpropagates type inference. It's 256KiB, until you pass it to a function that accepts byte arrays, whereupon Rust snaps it to the right size.
Yeah the rule is that integer literals default to i32 unless some other constraint is deduced. In production code, there's almost always some constraint, but in hello-world examples not always.
The comment says it's using a 64 KiB buffer but the code allocates a 256 KiB buffer.
Maybe the code should be
[u8; 65536]
or['\0'; 65536]
?Or leave it. It works fine as is!
Link to the code:
BLAKE3/b3sum/src/main.rs
Line 261 in 4b7babb
The text was updated successfully, but these errors were encountered: