From 8e48a8d8f3d72a18e6edc3f8fd56e6cb5ccc6225 Mon Sep 17 00:00:00 2001 From: Paul Bone Date: Thu, 8 Oct 2020 22:43:35 +0000 Subject: [PATCH] Bug 1656155 - pt 4. Update size class fields in jemalloc_stats_t r=glandium Previously there was one field here named small_max, and it wasn't obvious from the name alone whether this meant the end of the quantum-spaced sizes or the subpage sizes. Instead place both these fields into the structure with clearer names. Besides, a later page will need subpage_max. Differential Revision: https://phabricator.services.mozilla.com/D88402 --- memory/build/mozjemalloc.cpp | 2 +- memory/build/mozjemalloc_types.h | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/memory/build/mozjemalloc.cpp b/memory/build/mozjemalloc.cpp index 1fd371f6444a..165078360e3a 100644 --- a/memory/build/mozjemalloc.cpp +++ b/memory/build/mozjemalloc.cpp @@ -4250,7 +4250,7 @@ inline void MozJemalloc::jemalloc_stats_internal( aStats->opt_junk = opt_junk; aStats->opt_zero = opt_zero; aStats->quantum = kQuantum; - aStats->small_max = kMaxQuantumClass; + aStats->quantum_max = kMaxQuantumClass; aStats->large_max = gMaxLargeClass; aStats->chunksize = kChunkSize; aStats->page_size = gPageSize; diff --git a/memory/build/mozjemalloc_types.h b/memory/build/mozjemalloc_types.h index e414c2cc583f..d86768b53eef 100644 --- a/memory/build/mozjemalloc_types.h +++ b/memory/build/mozjemalloc_types.h @@ -75,11 +75,12 @@ typedef struct arena_params_s { // file. typedef struct { // Run-time configuration settings. - bool opt_junk; // Fill allocated memory with kAllocJunk? - bool opt_zero; // Fill allocated memory with 0x0? - size_t narenas; // Number of arenas. - size_t quantum; // Allocation quantum. - size_t small_max; // Max quantum-spaced allocation size. + bool opt_junk; // Fill allocated memory with kAllocJunk? + bool opt_zero; // Fill allocated memory with 0x0? + size_t narenas; // Number of arenas. + size_t quantum; // Allocation quantum. + size_t quantum_max; // Max quantum-spaced allocation size. + // The next size class, sub-pagesize's max is always page_size/2. size_t large_max; // Max sub-chunksize allocation size. size_t chunksize; // Size of each virtual memory mapping. size_t page_size; // Size of pages.