Commit 7b006ff1 authored by Chris Palmer's avatar Chris Palmer Committed by Commit Bot

Revert "[PartitionAlloc] Don't poison memory on free."

This reverts commit 99391f02.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [PartitionAlloc] Don't poison memory on free.
> 
> It might? be the cause of a perf regression.
> 
> Bug: 882471,680657
> Change-Id: Iec34a348426ccfdf5864a3b2cbe0c377da20ac0e
> Reviewed-on: https://chromium-review.googlesource.com/1220468
> Commit-Queue: Chris Palmer <palmer@chromium.org>
> Reviewed-by: Emil A Eklund <eae@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#590508}

TBR=palmer@chromium.org,eae@chromium.org,haraken@chromium.org

Change-Id: I6c687b8cb2b8aa0bc3de682c1c39f430b1f6b05c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 882471, 680657
Reviewed-on: https://chromium-review.googlesource.com/1220815Reviewed-by: default avatarChris Palmer <palmer@chromium.org>
Commit-Queue: Chris Palmer <palmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590545}
parent f8039fb5
...@@ -209,9 +209,13 @@ ALWAYS_INLINE void PartitionPage::Free(void* ptr) { ...@@ -209,9 +209,13 @@ ALWAYS_INLINE void PartitionPage::Free(void* ptr) {
PartitionCookieCheckValue(ptr); PartitionCookieCheckValue(ptr);
PartitionCookieCheckValue(reinterpret_cast<char*>(ptr) + slot_size - PartitionCookieCheckValue(reinterpret_cast<char*>(ptr) + slot_size -
kCookieSize); kCookieSize);
#endif
// Perhaps surprisingly, this does not measurably regress performance. See
// https://crbug.com/680657 for history. We formerly did this in
// |PartitionFree|, and in `DCHECK_IS_ON()` builds we redundantly did it
// here, too. Now we only do it here, unconditionally.
memset(ptr, kFreedByte, slot_size); memset(ptr, kFreedByte, slot_size);
#endif
DCHECK(this->num_allocated_slots); DCHECK(this->num_allocated_slots);
// TODO(palmer): See if we can afford to make this a CHECK. // TODO(palmer): See if we can afford to make this a CHECK.
......
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