• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "src/zone/zone-segment.h"
6 
7 #include "src/msan.h"
8 
9 namespace v8 {
10 namespace internal {
11 
ZapContents()12 void Segment::ZapContents() {
13 #ifdef DEBUG
14   memset(reinterpret_cast<void*>(start()), kZapDeadByte, capacity());
15 #endif
16   MSAN_ALLOCATED_UNINITIALIZED_MEMORY(start(), capacity());
17 }
18 
ZapHeader()19 void Segment::ZapHeader() {
20 #ifdef DEBUG
21   memset(this, kZapDeadByte, sizeof(Segment));
22 #endif
23   MSAN_ALLOCATED_UNINITIALIZED_MEMORY(start(), sizeof(Segment));
24 }
25 
26 }  // namespace internal
27 }  // namespace v8
28