avoid usize overflow for MAXIMUM_APPEND_VEC_FILE_SIZE on 32-bit platforms

This commit is contained in:
Anton Lazarev 2021-12-01 20:26:54 -08:00 committed by Michael Vines
parent d1d7182365
commit adbf31b98c
1 changed files with 3 additions and 0 deletions

View File

@ -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;