Skip to content

Commit db35f1d

Browse files
committed
fix(segment): suppress mmap dead-code warnings on wasm32
The mmap_budget_used and mmap_budget_limit fields in SegmentReader are only accessed by the native mmap_view path. Gate them with #[cfg_attr(target_arch = "wasm32", allow(dead_code))] so wasm32 builds are warning-clean.
1 parent f4d643c commit db35f1d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/segment/reader.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ pub struct SegmentReader<V: Vfs + Clone> {
3131
/// but this reader is reading a segment sealed under an older epoch.
3232
mk_override: Option<crate::crypto::keys::MasterKey>,
3333
/// Shared budget counter for `mmap_view` scratch bytes. Cloned from `Db`.
34+
/// Only read by the native `mmap_view` path; unused on `wasm32`.
35+
#[cfg_attr(target_arch = "wasm32", allow(dead_code))]
3436
mmap_budget_used: std::sync::Arc<std::sync::atomic::AtomicU64>,
3537
/// Maximum bytes allowed across all live mmap views for this Db.
38+
/// Only read by the native `mmap_view` path; unused on `wasm32`.
39+
#[cfg_attr(target_arch = "wasm32", allow(dead_code))]
3640
mmap_budget_limit: u64,
3741
/// v2 extent index, lazily loaded on the first `find_extent` call.
3842
/// `None` = not yet loaded (or v1 segment).

0 commit comments

Comments
 (0)