Commit 99b7cca3 authored by Bartek Nowierski's avatar Bartek Nowierski Committed by Commit Bot

[PartitionAlloc] Change CHECK to DCHECK in GigaCage's Find/FreeChunk

While investigating a perf regression bug, I tried this CL and it looks
it improved 1~1.5% on a couple scenarios, so might be worth taking.
https://pinpoint-dot-chromeperf.appspot.com/job/117de375520000

Drive by: change a nearby DCHECK_LE to PA_DCHECK while at it.

Change-Id: I048898938286c3347aeaf6c5672a1bb79bc90b5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2539221
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828027}
parent 993aa062
...@@ -142,7 +142,7 @@ void AddressPoolManager::Pool::Reset() { ...@@ -142,7 +142,7 @@ void AddressPoolManager::Pool::Reset() {
uintptr_t AddressPoolManager::Pool::FindChunk(size_t requested_size) { uintptr_t AddressPoolManager::Pool::FindChunk(size_t requested_size) {
base::AutoLock scoped_lock(lock_); base::AutoLock scoped_lock(lock_);
PA_CHECK(!(requested_size & kSuperPageOffsetMask)); PA_DCHECK(!(requested_size & kSuperPageOffsetMask));
const size_t need_bits = requested_size >> kSuperPageShift; const size_t need_bits = requested_size >> kSuperPageShift;
// Use first-fit policy to find an available chunk from free chunks. Start // Use first-fit policy to find an available chunk from free chunks. Start
...@@ -196,10 +196,10 @@ uintptr_t AddressPoolManager::Pool::FindChunk(size_t requested_size) { ...@@ -196,10 +196,10 @@ uintptr_t AddressPoolManager::Pool::FindChunk(size_t requested_size) {
void AddressPoolManager::Pool::FreeChunk(uintptr_t address, size_t free_size) { void AddressPoolManager::Pool::FreeChunk(uintptr_t address, size_t free_size) {
base::AutoLock scoped_lock(lock_); base::AutoLock scoped_lock(lock_);
PA_CHECK(!(address & kSuperPageOffsetMask)); PA_DCHECK(!(address & kSuperPageOffsetMask));
PA_CHECK(!(free_size & kSuperPageOffsetMask)); PA_DCHECK(!(free_size & kSuperPageOffsetMask));
DCHECK_LE(address_begin_, address); PA_DCHECK(address_begin_ <= address);
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
PA_DCHECK(address + free_size <= address_end_); PA_DCHECK(address + free_size <= address_end_);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment