zone-segment.cc 669 Bytes
Newer Older
heimbuef's avatar
heimbuef committed
1 2 3 4 5 6
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/zone/zone-segment.h"

7
#include "src/base/sanitizer/msan.h"
8

heimbuef's avatar
heimbuef committed
9 10 11 12 13
namespace v8 {
namespace internal {

void Segment::ZapContents() {
#ifdef DEBUG
14
  memset(reinterpret_cast<void*>(start()), kZapDeadByte, capacity());
heimbuef's avatar
heimbuef committed
15
#endif
16
  MSAN_ALLOCATED_UNINITIALIZED_MEMORY(start(), capacity());
heimbuef's avatar
heimbuef committed
17 18 19 20 21 22
}

void Segment::ZapHeader() {
#ifdef DEBUG
  memset(this, kZapDeadByte, sizeof(Segment));
#endif
23
  MSAN_ALLOCATED_UNINITIALIZED_MEMORY(start(), sizeof(Segment));
heimbuef's avatar
heimbuef committed
24
}
25

heimbuef's avatar
heimbuef committed
26 27
}  // namespace internal
}  // namespace v8