Skip to content

Commit c50772e

Browse files
committed
first draft
1 parent 70f19b4 commit c50772e

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

docs/cpp/hybrid-patchable.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,21 @@ helpviewer_keywords: ["__declspec keyword [C++], hybrid_patchable", "hybrid_patc
99

1010
**Microsoft Specific**
1111

12-
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.
1313

1414
## Syntax
1515

1616
> `__declspec(hybrid_patchable)`
1717
1818
## Remarks
1919

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.
2121

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:**
2523

2624
```cpp
27-
__declspec(hybrid_patchable) int Example() {
25+
__declspec(hybrid_patchable) int Example()
26+
{
2827
return 1;
2928
}
3029
```
@@ -42,15 +41,9 @@ EXP+#Example:
4241
00000001400CE00F: CC int 3
4342
```
4443
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.
49-
5044
**END Microsoft Specific**
5145
5246
## See also
5347
5448
[`__declspec`](../cpp/declspec.md)\
55-
[`noexcept`](noexcept-cpp.md)\
56-
[Keywords](../cpp/keywords-cpp.md)
49+
[Fast-Forward sequences](/windows/arm/arm64ec-abi)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy