Skip to content

Commit 1e252ac

Browse files
authored
Merge pull request #2980 from corob-msft/docs/corob/noalias
Update noalias docs per Natalia G. in VCSig
2 parents c4b7b25 + 6d30b24 commit 1e252ac

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/cpp/noalias.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
---
22
title: "noalias"
3-
ms.date: "02/09/2018"
3+
ms.date: 07/07/2020
44
f1_keywords: ["noalias_cpp"]
55
helpviewer_keywords: ["noalias __declspec keyword", "__declspec keyword [C++], noalias"]
66
ms.assetid: efafa8b0-7f39-4edc-a81e-d287ae882c9b
77
---
8-
# noalias
8+
# `noalias`
99

10-
**Microsoft Specific**
10+
**Microsoft-specific**
1111

12-
**noalias** means that a function call does not modify or reference visible global state and only modifies the memory pointed to *directly* by pointer parameters (first-level indirections).
12+
**`noalias`** means that a function call doesn't modify or reference visible global state and only modifies the memory pointed to *directly* by pointer parameters (first-level indirections).
1313

14-
If a function is annotated as **noalias**, the optimizer can assume that, in addition to the parameters themselves, only first-level indirections of pointer parameters are referenced or modified inside the function. The visible global state is the set of all data that is not defined or referenced outside of the compilation scope, and their address is not taken. The compilation scope is all source files ([/LTCG (Link-time Code Generation)](../build/reference/ltcg-link-time-code-generation.md) builds) or a single source file (non-**/LTCG** build).
14+
If a function is annotated as **`noalias`**, the optimizer can assume that only the parameters themselves, and only first-level indirections of pointer parameters, are referenced or modified inside the function.
1515

16-
The **noalias** annotation only applies within the body of the annotated function. Marking a function as **__declspec(noalias)** does not affect the aliasing of pointers returned by the function.
16+
The **`noalias`** annotation only applies within the body of the annotated function. Marking a function as **`__declspec(noalias)`** doesn't affect the aliasing of pointers returned by the function.
1717

18-
For another annotation that can impact aliasing, see [__declspec(restrict)](../cpp/restrict.md).
18+
For another annotation that can impact aliasing, see [`__declspec(restrict)`](../cpp/restrict.md).
1919

2020
## Example
2121

22-
The following sample demonstrates the use of **__declspec(noalias)**.
22+
The following sample demonstrates the use of **`__declspec(noalias)`**.
2323

24-
When the function `multiply` that accesses memory is annotated **__declspec(noalias)**, it tells the compiler that this function does not modify the global state except through the pointers in its parameter list.
24+
When the function `multiply` that accesses memory is annotated **`__declspec(noalias)`**, it tells the compiler that this function doesn't modify the global state except through the pointers in its parameter list.
2525

2626
```C
2727
// declspec_noalias.c
@@ -91,6 +91,6 @@ int main()
9191
9292
## See also
9393
94-
[__declspec](../cpp/declspec.md)<br/>
94+
[`__declspec`](../cpp/declspec.md)<br/>
9595
[Keywords](../cpp/keywords-cpp.md)<br/>
96-
[__declspec(restrict)](../cpp/restrict.md)
96+
[`__declspec(restrict)`](../cpp/restrict.md)

0 commit comments

Comments
 (0)