Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tcmalloc/internal/percpu_tcmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1495,8 +1495,10 @@ void TcmallocSlab<NumClasses>::ReleaseSlabMetadataForDrainedCpus(
// end perfectly on a hugepage boundary. (At the very least,
// we'd risk tearing a hugepage.)
void* slabs_end = CpuMemoryStart(slabs, shift, n_cpus);
hugepage_status[address_to_hugepage_number(slabs_end) - base_hugepage_nr] =
kCannotFree;
if (!IsAlignedTo(slabs_end, kHugePageSize)) {
hugepage_status[address_to_hugepage_number(slabs_end) - base_hugepage_nr] =
kCannotFree;
}

// Go through all the CPUs and figure out which hugepage its slab
// lives in. (Because we've already tested that slabs are slab-aligned
Expand Down
Loading