File indexing completed on 2025-04-02 08:54:42
0001
0002
0003
0004
0005 #ifndef INCLUDE_CPPGC_MACROS_H_
0006 #define INCLUDE_CPPGC_MACROS_H_
0007
0008 #include <cstddef>
0009
0010 #include "cppgc/internal/compiler-specific.h"
0011
0012 namespace cppgc {
0013
0014
0015
0016
0017 #if defined(__clang__)
0018 #define CPPGC_STACK_ALLOCATED() \
0019 public: \
0020 using IsStackAllocatedTypeMarker CPPGC_UNUSED = int; \
0021 \
0022 private: \
0023 void* operator new(size_t) = delete; \
0024 void* operator new(size_t, void*) = delete; \
0025 static_assert(true, "Force semicolon.")
0026 #define CPPGC_STACK_ALLOCATED_IGNORE(bug_or_reason) \
0027 __attribute__((annotate("stack_allocated_ignore")))
0028 #else
0029 #define CPPGC_STACK_ALLOCATED() static_assert(true, "Force semicolon.")
0030 #define CPPGC_STACK_ALLOCATED_IGNORE(bug_or_reason)
0031 #endif
0032
0033 }
0034
0035 #endif