Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
1// Copyright 2020 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#ifndef INCLUDE_CPPGC_COMMON_H_
6#define INCLUDE_CPPGC_COMMON_H_
7
8#include "cppgc/macros.h"
9#include "v8config.h" // NOLINT(build/include_directory)
10
11#if V8_CC_MSVC
12#include <intrin.h> // _AddressOfReturnAddress()
13#endif
14
15namespace cppgc {
16
29};
30
38
39 public:
40#if V8_CC_MSVC
41 explicit StackStartScope(void* stack_start = _AddressOfReturnAddress());
42#else
43 explicit StackStartScope(void* stack_start = __builtin_frame_address(0));
44#endif
46
49
50 private:
51 void* const previous_stack_start_;
52};
53
54} // namespace cppgc
55
56#endif // INCLUDE_CPPGC_COMMON_H_
Definition: common.h:36
StackStartScope(const StackStartScope &)=delete
StackStartScope(void *stack_start=__builtin_frame_address(0))
StackStartScope & operator=(const StackStartScope &)=delete
#define CPPGC_STACK_ALLOCATED()
Definition: macros.h:44
Definition: allocation.h:39
EmbedderStackState
Definition: common.h:20
#define V8_EXPORT
Definition: v8config.h:875
#define V8_NODISCARD
Definition: v8config.h:711