diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /memory/build/mozjemalloc.cpp | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'memory/build/mozjemalloc.cpp')
-rw-r--r-- | memory/build/mozjemalloc.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/memory/build/mozjemalloc.cpp b/memory/build/mozjemalloc.cpp index 9c63705ce7..27ad60c076 100644 --- a/memory/build/mozjemalloc.cpp +++ b/memory/build/mozjemalloc.cpp @@ -438,7 +438,13 @@ struct arena_chunk_t { // Maximum size of L1 cache line. This is used to avoid cache line aliasing, // so over-estimates are okay (up to a point), but under-estimates will // negatively affect performance. -static const size_t kCacheLineSize = 64; +static const size_t kCacheLineSize = +#if defined(XP_DARWIN) && defined(__aarch64__) + 128 +#else + 64 +#endif + ; // Our size classes are inclusive ranges of memory sizes. By describing the // minimums and how memory is allocated in each range the maximums can be @@ -1518,7 +1524,12 @@ MALLOC_RUNTIME_VAR PoisonType opt_poison = ALL; MALLOC_RUNTIME_VAR PoisonType opt_poison = SOME; #endif -MALLOC_RUNTIME_VAR size_t opt_poison_size = kCacheLineSize * 4; +// Keep this larger than and ideally a multiple of kCacheLineSize; +MALLOC_RUNTIME_VAR size_t opt_poison_size = 256; +#ifndef MALLOC_RUNTIME_CONFIG +static_assert(opt_poison_size >= kCacheLineSize); +static_assert((opt_poison_size % kCacheLineSize) == 0); +#endif static bool opt_randomize_small = true; |