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
In some places usize is being used in situations where it would be better to explicitly define what bit size we want to use. One example can be found here:
// TODO: This will blow up on 32 bit systems, because usize can be 32 bits.
let length = reader.read_u64::<BigEndian>()? asusize;
Motivation
The crate is currently built with a 64 bit word size in mind, this will cause issues when run on a 32-bit system
Explanation
Review all uses of usize, evaluate if u64 would be more appropriate, change the types, fix any compiler errors that occour. (optional: build and run on a 32 bit system to check compatability)
Unresolved Questions
Is this something that should be done now? are there valid reasons to postpone this work? Are there any other relevant issues that have not been described in this ticket
The text was updated successfully, but these errors were encountered:
@FreddieRidell I fully agree with you here, and would welcome patches to change this. We've done this in a few other crates too already. There shouldn't be any blockers to landing such changes.
Feature Request
Summary
In some places
usize
is being used in situations where it would be better to explicitly define what bit size we want to use. One example can be found here:hypercore/src/storage/node.rs
Lines 53 to 54 in c7c8757
Motivation
The crate is currently built with a 64 bit word size in mind, this will cause issues when run on a 32-bit system
Explanation
Review all uses of
usize
, evaluate ifu64
would be more appropriate, change the types, fix any compiler errors that occour. (optional: build and run on a 32 bit system to check compatability)Unresolved Questions
Is this something that should be done now? are there valid reasons to postpone this work? Are there any other relevant issues that have not been described in this ticket
The text was updated successfully, but these errors were encountered: