mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 15:10:48 +01:00
Avoid a warning from the use of floating-point in zstd
Replace "(preset - 0.5) * 1mb" with "preset * 1mb - 0.5 mb", to avoid warning about converting double to size_t.
This commit is contained in:
parent
be0557f759
commit
4038202f89
1 changed files with 2 additions and 1 deletions
|
@ -145,7 +145,8 @@ tor_zstd_state_size_precalc(int compress, int preset)
|
|||
// variables that are not exposed via the public API. We use a _very_
|
||||
// simplified function to calculate the estimated amount of bytes used in
|
||||
// this struct.
|
||||
memory_usage += (preset - 0.5) * 1024 * 1024;
|
||||
// memory_usage += (preset - 0.5) * 1024 * 1024;
|
||||
memory_usage += (preset * 1024 * 1024) - (512 * 1024);
|
||||
// - ZSTD_sizeof_CDict(stream->cdictLocal): Unused in Tor: 0 bytes.
|
||||
// - stream->outBuffSize: 128 KB:
|
||||
memory_usage += 128 * 1024;
|
||||
|
|
Loading…
Add table
Reference in a new issue