Skip to content

Commit 2c7c352

Browse files
Folkert de Vriesfolkertdev
authored andcommitted
inline MEM_64bits in some places
1 parent 1bb3b35 commit 2c7c352

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/decompress/zstd_decompress_block.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::lib::common::bitstream::BIT_DStream_t;
99
use crate::lib::common::entropy_common::FSE_readNCount_slice;
1010
use crate::lib::common::error_private::{ERR_isError, Error};
1111
use crate::lib::common::huf::{HUF_flags_bmi2, HUF_flags_disableAsm};
12-
use crate::lib::common::mem::{MEM_32bits, MEM_64bits, MEM_readLE24};
12+
use crate::lib::common::mem::{MEM_32bits, MEM_readLE24};
1313
use crate::lib::common::reader::Reader;
1414
use crate::lib::common::zstd_internal::{
1515
LLFSELog, LL_bits, MLFSELog, ML_bits, MaxFSELog, MaxLL, MaxLLBits, MaxML, MaxMLBits, MaxOff,
@@ -2359,8 +2359,8 @@ pub(crate) fn ZSTD_decompressBlock_internal_help(
23592359
if dst.is_empty() && nbSeq > 0 {
23602360
return Err(Error::dstSize_tooSmall);
23612361
}
2362-
if MEM_64bits()
2363-
&& ::core::mem::size_of::<size_t>() == ::core::mem::size_of::<*mut core::ffi::c_void>()
2362+
if size_of::<usize>() == 8
2363+
&& size_of::<size_t>() == size_of::<*mut core::ffi::c_void>()
23642364
&& (usize::MAX - dst.as_mut_ptr() as usize) < (1 << 20)
23652365
{
23662366
return Err(Error::dstSize_tooSmall);
@@ -2378,7 +2378,7 @@ pub(crate) fn ZSTD_decompressBlock_internal_help(
23782378
}
23792379

23802380
if !use_prefetch_decoder {
2381-
let minShare = (if MEM_64bits() { 7 } else { 20 }) as u32;
2381+
let minShare = (if size_of::<usize>() == 8 { 7 } else { 20 }) as u32;
23822382
use_prefetch_decoder = info.longOffsetShare >= minShare;
23832383
}
23842384
}

0 commit comments

Comments
 (0)