rust-bitcoin-unsafe-fast/bitcoin
Tobin C. Harding c427d8b213
bitcoin: Compile time assert on index size
Currently we enforce that our code only runs on machines with a
certain pointer width (32 or 64 by failing to compile if pointer size
width is 16). One of the underlying reasons is because of requirements
in consensus code in Bitcoin Core which requires containers with more
than 2^16 (65536) items [0].

We can better express our requirements by asserting on Rust's index
size (the `usize` type).

As a side benefit, there is active work [1] to make Rust support
architectures where pointer width != idex size. With this patch applied
`rust-bitcoin` will function correctly even if that work progresses.

- [0] https://github.com/rust-bitcoin/rust-bitcoin/pull/2929#discussion_r1659399813
- [1] https://github.com/rust-lang/rust/issues/65473
2024-08-05 05:36:21 +10:00
..
contrib Bump MSRV to 1.63 2024-07-27 07:24:32 +02:00
embedded Move opcodes to primitives 2024-07-09 15:26:33 +10:00
examples Use lower case error messages 2024-07-15 09:25:08 +01:00
src bitcoin: Compile time assert on index size 2024-08-05 05:36:21 +10:00
tests 2024-07-21 automated rustfmt nightly 2024-07-21 01:11:38 +00:00
CHANGELOG.md Capitalize Merkle 2024-07-01 17:42:43 +01:00
Cargo.toml Bump MSRV to 1.63 2024-07-27 07:24:32 +02:00
build.rs Use lower case error messages 2024-07-15 09:25:08 +01:00