diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-04-12 12:25:51 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-04-12 12:25:51 -0400 |
commit | 467c882baa9f08e46428319cea67f57bb4287730 (patch) | |
tree | 5ce4cf554dea88ae307c025e9e554900f684b4c7 /src | |
parent | 037fb0c804efda988c5c05f0384fccd426f807d0 (diff) | |
parent | 4aaa4215e7e11f318c5a50124e29dc0b50ce21e1 (diff) | |
download | tor-467c882baa9f08e46428319cea67f57bb4287730.tar.gz tor-467c882baa9f08e46428319cea67f57bb4287730.zip |
Merge branch 'maint-0.3.3'
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c index 1eabf49f7b..4064cf64ab 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -4531,7 +4531,15 @@ compute_real_max_mem_in_queues(const uint64_t val, int log_guess) /* We detected the amount of memory available. */ uint64_t avail = 0; - if (ram >= (8 * ONE_GIGABYTE)) { +#if SIZEOF_SIZE_T > 4 +/* On a 64-bit platform, we consider 8GB "very large". */ +#define RAM_IS_VERY_LARGE(x) ((x) >= (8 * ONE_GIGABYTE)) +#else +/* On a 32-bit platform, we can't have 8GB of ram. */ +#define RAM_IS_VERY_LARGE(x) (0) +#endif + + if (RAM_IS_VERY_LARGE(ram)) { /* If we have 8 GB, or more, RAM available, we set the MaxMemInQueues * to 0.4 * RAM. The idea behind this value is that the amount of RAM * is more than enough for a single relay and should allow the relay |