chromium/base/allocator/partition_allocator/src/partition_alloc/partition_cookie.h

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PARTITION_ALLOC_PARTITION_COOKIE_H_
#define PARTITION_ALLOC_PARTITION_COOKIE_H_

#include "partition_alloc/buildflags.h"
#include "partition_alloc/partition_alloc_base/compiler_specific.h"
#include "partition_alloc/partition_alloc_check.h"

namespace partition_alloc::internal {

static constexpr size_t kCookieSize =;

// Cookie is enabled for debug builds.
#if PA_BUILDFLAG(DCHECKS_ARE_ON)

inline constexpr unsigned char kCookieValue[kCookieSize] =;

constexpr size_t kPartitionCookieSizeAdjustment =;

PA_ALWAYS_INLINE void PartitionCookieCheckValue(unsigned char* cookie_ptr) {}

PA_ALWAYS_INLINE void PartitionCookieWriteValue(unsigned char* cookie_ptr) {}

#else

constexpr size_t kPartitionCookieSizeAdjustment = 0;

PA_ALWAYS_INLINE void PartitionCookieCheckValue(unsigned char* address) {}

PA_ALWAYS_INLINE void PartitionCookieWriteValue(unsigned char* cookie_ptr) {}

#endif  // PA_BUILDFLAG(DCHECKS_ARE_ON)

}  // namespace partition_alloc::internal

#endif  // PARTITION_ALLOC_PARTITION_COOKIE_H_