Expand description
§Vec64
High-performance Rust vector type with automatic 64-byte SIMD alignment.
§Summary
Vec64<T> is a drop-in replacement for Vec<T> that ensures the starting pointer is aligned to a 64-byte boundary.
This alignment is useful for optimal performance with SIMD instruction extensions like AVX-512, and helps avoid split loads/stores across cache lines.
Benefits will vary based on one’s target architecture.
§WASM Compatibility
Enable the wasm feature for Web Worker-based parallelism:
vec64 = { version = "0.3", features = ["wasm"] }Required build configuration (.cargo/config.toml):
[target.wasm32-unknown-unknown]
rustflags = ["-C", "target-feature=+atomics,+bulk-memory"]
[unstable]
build-std = ["panic_abort", "std"]Build with wasm-pack:
wasm-pack build --target webInitialise the thread pool from JavaScript before using parallel methods:
import init, { initThreadPool } from './pkg/your_crate.js';
await init();
await initThreadPool(navigator.hardwareConcurrency);Note: Requires nightly Rust with rust-src component for build-std. The browser
needs SharedArrayBuffer support (cross-origin isolation via COOP/COEP headers).
See wasm-test/ for a complete working example.
Re-exports§
Modules§
- alloc64
- Allocator64 Module - Custom 64-Byte Aligned Vec Allocator
- vec64
- Vec64 - Special Vector with 64-Byte SIMD Alignment
Macros§
Type Aliases§
- Vec64
Alloc - Allocator type backing Vec64, determined by feature flags.