From adbf31b98ce6421dae30023736020601cdab1d4a Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Wed, 1 Dec 2021 20:26:54 -0800 Subject: [PATCH] avoid usize overflow for MAXIMUM_APPEND_VEC_FILE_SIZE on 32-bit platforms --- runtime/src/append_vec.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/src/append_vec.rs b/runtime/src/append_vec.rs index 7811e91afe..cfdf3f5729 100644 --- a/runtime/src/append_vec.rs +++ b/runtime/src/append_vec.rs @@ -33,7 +33,10 @@ macro_rules! u64_align { }; } +#[cfg(target_pointer_width = "64")] const MAXIMUM_APPEND_VEC_FILE_SIZE: usize = 16 * 1024 * 1024 * 1024; // 16 GiB +#[cfg(target_pointer_width = "32")] +const MAXIMUM_APPEND_VEC_FILE_SIZE: usize = 2 * 1024 * 1024 * 1024; // 2 GiB pub type StoredMetaWriteVersion = u64;