Commit 253798c2 authored by Bartek Nowierski's avatar Bartek Nowierski Committed by Chromium LUCI CQ

PA: Remove DCHECK from AllocFlagsNoHooks->PartitionRefCountPointer path

If GigaCage isn't enabled, this DCHECK will get triggered:
AllocFlagsNoHooks->PartitionRefCountPointer->DCheckGetSlotOffsetIsZero->
->PartitionAllocGetSlotOffset->
->DCheckIfManagedByPartitionAllocNormalBuckets

GigaCage isn't needed to set up PartitionRefCount. It's only needed to
easily detect from BackupRefPtr code if PartitionRefCount is available,
but this won't be an issue because BackupRefPtr is disabled when
GigaCage isn't needed.

Bug: 1073933
Change-Id: Iaea2781d207e9534293a1b3dd57dd6c42a422ed7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2620922Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842036}
parent 90e19f63
......@@ -108,6 +108,11 @@ ALWAYS_INLINE PartitionRefCount* PartitionRefCountPointer(void* slot_start) {
return reinterpret_cast<PartitionRefCount*>(slot_start);
}
ALWAYS_INLINE PartitionRefCount* PartitionRefCountPointerNoDCheck(
void* slot_start) {
return reinterpret_cast<PartitionRefCount*>(slot_start);
}
#else // ENABLE_REF_COUNTER_FOR_BACKUP_REF_PTR
static constexpr size_t kInSlotRefCountBufferSize = 0;
......
......@@ -1234,7 +1234,7 @@ ALWAYS_INLINE void* PartitionRoot<thread_safe>::AllocFlagsNoHooks(
bool is_direct_mapped = raw_size > kMaxBucketed;
if (allow_extras && !is_direct_mapped) {
#if ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR
new (internal::PartitionRefCountPointer(slot_start))
new (internal::PartitionRefCountPointerNoDCheck(slot_start))
internal::PartitionRefCount();
#endif // ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR
}
......
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