Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(927)

Unified Diff: src/zone/zone.cc

Issue 2377943003: Fixed zapping of contents (Closed)
Patch Set: Fixed zapping of contents Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/zone/zone.cc
diff --git a/src/zone/zone.cc b/src/zone/zone.cc
index 91506dd6d206fbba28653483de5beca4011cc9d5..a43aea5bb7ca8e82adb6d13c910be107beb50027 100644
--- a/src/zone/zone.cc
+++ b/src/zone/zone.cc
@@ -112,9 +112,8 @@ void Zone::DeleteAll() {
#ifdef DEBUG
// Un-poison first so the zapping doesn't trigger ASan complaints.
ASAN_UNPOISON_MEMORY_REGION(current, size);
- // Zap the entire current segment (including the header).
- memset(current, kZapDeadByte, size);
#endif
+ current->ZapContents();
segment_bytes_allocated_ -= size;
allocator_->FreeSegment(current);
}
@@ -131,10 +130,7 @@ void Zone::DeleteAll() {
limit_ = keep->end();
// Un-poison so we can re-use the segment later.
ASAN_UNPOISON_MEMORY_REGION(start, keep->capacity());
-#ifdef DEBUG
- // Zap the contents of the kept segment (but not the header).
- memset(start, kZapDeadByte, keep->capacity());
-#endif
+ keep->ZapContents();
} else {
position_ = limit_ = 0;
}

Powered by Google App Engine
This is Rietveld 408576698