tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 6c57baa9339508956757b5ffaad69cc8b59cedbd
parent 0bd70563fbc9583f94b6e9d75370fbedfb059d66
Author: Paul Bone <paul@bone.id.au>
Date:   Tue, 18 Nov 2025 00:46:45 +0000

Bug 1993227 - Rename some chunk allocation functions r=glandium DONTBUILD

These functions can be used more generically and don't need "chunk" in
their name.

Differential Revision: https://phabricator.services.mozilla.com/D272368

Diffstat:
Mmemory/build/Chunk.cpp | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/memory/build/Chunk.cpp b/memory/build/Chunk.cpp @@ -395,8 +395,8 @@ static bool pages_purge(void* addr, size_t length, bool force_zero) { return true; } -// pages_trim, chunk_alloc_mmap_slow and chunk_alloc_mmap were cherry-picked -// from upstream jemalloc 3.4.1 to fix Mozilla bug 956501. +// pages_trim, pages_mmap_aligned_slow and pages_mmap_aligned were +// cherry-picked from upstream jemalloc 3.4.1 to fix Mozilla bug 956501. static void* pages_trim(void* addr, size_t alloc_size, size_t leadsize, size_t size) { @@ -432,7 +432,7 @@ static void* pages_trim(void* addr, size_t alloc_size, size_t leadsize, #endif } -static void* chunk_alloc_mmap_slow(size_t size, size_t alignment) { +static void* pages_mmap_aligned_slow(size_t size, size_t alignment) { void *ret, *pages; size_t alloc_size, leadsize; @@ -455,7 +455,7 @@ static void* chunk_alloc_mmap_slow(size_t size, size_t alignment) { return ret; } -static void* chunk_alloc_mmap(size_t size, size_t alignment) { +static void* pages_mmap_aligned(size_t size, size_t alignment) { void* ret; size_t offset; @@ -476,7 +476,7 @@ static void* chunk_alloc_mmap(size_t size, size_t alignment) { offset = ALIGNMENT_ADDR2OFFSET(ret, alignment); if (offset != 0) { pages_unmap(ret, size); - return chunk_alloc_mmap_slow(size, alignment); + return pages_mmap_aligned_slow(size, alignment); } MOZ_ASSERT(ret); @@ -727,7 +727,7 @@ void* chunk_alloc(size_t aSize, size_t aAlignment, bool aBase) { ret = chunk_recycle(aSize, aAlignment); } if (!ret) { - ret = chunk_alloc_mmap(aSize, aAlignment); + ret = pages_mmap_aligned(aSize, aAlignment); } if (ret && !aBase) { if (!gChunkRTree.Set(ret, ret)) {