You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use **`__declspec(hybrid_patchable)`** extended attribute which can be used in the declaration of functions.
12
+
Use `__declspec(hybrid_patchable)` to mark a function as a hybrid patchable function. This attribute is used to generate a fast-forward sequence of instructions that are executed before the function is called.
13
13
14
14
## Syntax
15
15
16
16
> `__declspec(hybrid_patchable)`
17
17
18
18
## Remarks
19
19
20
-
We recommend that all new code use the [`noexcept`](noexcept-cpp.md) operator rather than `__declspec(nothrow)`.
20
+
This is an ARM64EC-only feature.
21
21
22
-
This attribute tells the compiler that the declared function and the functions it calls never throw an exception. However, it does not enforce the directive. In other words, it never causes [`std::terminate`](../standard-library/exception-functions.md#terminate) to be invoked, unlike **`noexcept`**, or in **`std:c++17`** mode (Visual Studio 2017 version 15.5 and later), `throw()`.
23
-
24
-
With the synchronous exception handling model, now the default, the compiler can eliminate the mechanics of tracking the lifetime of certain unwindable objects in such a function, and significantly reduce the code size. Given the following preprocessor directive, the three function declarations below are equivalent in **`/std:c++14`** mode:
22
+
**Example:**
25
23
26
24
```cpp
27
-
__declspec(hybrid_patchable) int Example() {
25
+
__declspec(hybrid_patchable) int Example()
26
+
{
28
27
return 1;
29
28
}
30
29
```
@@ -42,15 +41,9 @@ EXP+#Example:
42
41
00000001400CE00F: CC int 3
43
42
```
44
43
45
-
46
-
In **`/std:c++17`** mode, `throw()` is not equivalent to the others that use `__declspec(nothrow)` because it causes `std::terminate` to be invoked if an exception is thrown from the function.
47
-
48
-
The `void __stdcall f3() throw();` declaration uses the syntax defined by the C++ standard. In C++17 the `throw()` keyword was deprecated.
0 commit comments