Skip to content

Commit fa15ac8

Browse files
authored
Update max value for /Gs per cpp-docs 4418 (#4809)
* Update max value for /Gs per cpp-docs 4418 * Add Acrolinx updates to fix for 4418 * Fix style typo
1 parent 7c184f5 commit fa15ac8

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
---
22
description: "Learn more about: /Gs (Control Stack Checking Calls)"
33
title: "/Gs (Control Stack Checking Calls)"
4-
ms.date: "10/25/2018"
4+
ms.date: 02/16/2023
55
f1_keywords: ["/GS"]
66
helpviewer_keywords: ["disabling stack probes", "GS compiler option [C++]", "/GS compiler option [C++]", "stack, stack probes", "stack probes", "-GS compiler option [C++]", "stack checking calls"]
77
ms.assetid: 40daed7c-f942-4085-b872-01e12b37729e
88
---
9-
# /Gs (Control Stack Checking Calls)
9+
# `/Gs` (Control stack checking calls)
1010

1111
Controls the threshold for stack probes.
1212

1313
## Syntax
1414

15-
> **/Gs**[*size*]
15+
> **`/Gs`**[*`size`*]
1616
1717
## Arguments
1818

19-
*size*<br/>
20-
(Optional) The number of bytes that local variables can occupy before a stack probe is initiated. No space is allowed between **/Gs** and *size*.
19+
*`size`*\
20+
(Optional) The number of bytes that local variables can occupy before a stack probe is initiated. No whitespace is allowed between **`/Gs`** and *`size`*.
2121

2222
## Remarks
2323

24-
A *stack probe* is a sequence of code that the compiler inserts at the beginning of a function call. When initiated, a stack probe reaches benignly into memory by the amount of space that is required to store the function's local variables. This causes the operating system to transparently page in additional stack memory if required, before the rest of the function runs.
24+
A *stack probe* is a sequence of code that the compiler inserts at the beginning of a function call. When initiated, a stack probe reaches benignly into memory by the amount of space required to store the function's local variables. This probe causes the operating system to transparently page in more stack memory if necessary, before the rest of the function runs.
2525

26-
By default, the compiler generates code that initiates a stack probe when a function requires more than one page of stack space. This is equivalent to a compiler option of **/Gs4096** for x86, x64, ARM, and ARM64 platforms. This value allows an application and the Windows memory manager to increase the amount of memory committed to the program stack dynamically at run time.
26+
By default, the compiler generates code that initiates a stack probe when a function requires more than one page of stack space. This default is equivalent to a compiler option of **`/Gs4096`** for x86, x64, ARM, and ARM64 platforms. This value allows an application and the Windows memory manager to increase the amount of memory committed to the program stack dynamically at run time.
2727

2828
> [!NOTE]
29-
> The default value of **/Gs4096** allows the program stack of applications for Windows to grow correctly at run time. We recommend that you do not change the default value unless you know exactly why you have to change it.
29+
> The default value of **`/Gs4096`** allows the program stack of applications for Windows to grow correctly at run time. We recommend that you do not change the default value unless you know exactly why you have to change it.
3030
31-
Some programs—for example, virtual device drivers—do not require this default stack-growth mechanism. In such cases, the stack probes are not necessary and you can stop the compiler from generating them by setting *size* to a value that is larger than any function will require for local variable storage.
31+
Some programs—for example, virtual device drivers—don't require this default stack-growth mechanism. In such cases, the stack probes aren't necessary and you can stop the compiler from generating them by setting *`size`* to a value that is larger than any function requires for local variable storage.
3232

33-
**/Gs0** initiates stack probes for every function call that requires storage for local variables. This can have a negative impact on performance.
33+
**`/Gs0`** initiates stack probes for every function call that requires storage for local variables. This value can have a negative impact on performance.
3434

35-
For x64 targets, if the **/Gs** option is specified without a *size* argument, it is the same as **/Gs0**. If the *size* argument is 1 through 9, warning D9014 is emitted, and the effect is the same as specifying **/Gs0**.
35+
For x64 targets, if you specify the **`/Gs`** option without a *`size`* argument, it's the same as **`/Gs0`**. If the *`size`* argument is 1 through 9, the compiler emits warning D9014, and the effect is the same as specifying **`/Gs0`**.
3636

37-
For x86, ARM, and ARM64 targets, the **/Gs** option without a *size* argument is the same as **/Gs4096**. If the *size* argument is 1 through 9, warning D9014 is emitted, and the effect is the same as specifying **/Gs4096**.
37+
For x86, ARM, and ARM64 targets, the **`/Gs`** option without a *`size`* argument is the same as **`/Gs4096`**. If the *`size`* argument is 1 through 9, the compiler emits warning D9014, and the effect is the same as specifying **`/Gs4096`**.
3838

39-
For all targets, a *size* argument between 10 and 2147485647 sets the threshold at the specified value. A *size* of 2147485648 or greater causes fatal error C1049.
39+
For all targets, a *`size`* argument between 10 and 2147483647 sets the threshold at the specified value. A *`size`* of 2147483648 or greater causes fatal error C1049.
4040

41-
You can turn stack probes on or off by using the [check_stack](../../preprocessor/check-stack.md) directive. **/Gs** and the `check_stack` pragma have no effect on standard C library routines; they affect only the functions you compile.
41+
You can turn stack probes on or off by using the [`check_stack`](../../preprocessor/check-stack.md) directive. **`/Gs`** and the `check_stack` pragma have no effect on standard C library routines; they affect only the functions you compile.
4242

4343
### To set this compiler option in the Visual Studio development environment
4444

@@ -54,5 +54,5 @@ You can turn stack probes on or off by using the [check_stack](../../preprocesso
5454

5555
## See also
5656

57-
[MSVC Compiler Options](compiler-options.md)<br/>
58-
[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
57+
[MSVC compiler options](compiler-options.md)\
58+
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)

0 commit comments

Comments
 (0)