2020-04-14 15:07:29 +00:00
|
|
|
// Copyright 2020 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.
|
|
|
|
|
|
|
|
#ifndef INCLUDE_CPPGC_MACROS_H_
|
|
|
|
#define INCLUDE_CPPGC_MACROS_H_
|
|
|
|
|
2020-06-16 22:41:00 +00:00
|
|
|
#include "cppgc/internal/compiler-specific.h"
|
|
|
|
|
2020-04-14 15:07:29 +00:00
|
|
|
namespace cppgc {
|
|
|
|
|
|
|
|
// Use if the object is only stack allocated.
|
2020-06-16 22:41:00 +00:00
|
|
|
#define CPPGC_STACK_ALLOCATED() \
|
|
|
|
public: \
|
|
|
|
using IsStackAllocatedTypeMarker CPPGC_UNUSED = int; \
|
|
|
|
\
|
|
|
|
private: \
|
|
|
|
void* operator new(size_t) = delete; \
|
|
|
|
void* operator new(size_t, void*) = delete; \
|
2020-05-13 21:09:27 +00:00
|
|
|
static_assert(true, "Force semicolon.")
|
2020-04-14 15:07:29 +00:00
|
|
|
|
|
|
|
} // namespace cppgc
|
|
|
|
|
|
|
|
#endif // INCLUDE_CPPGC_MACROS_H_
|