Skip to content

Commit bf54b40

Browse files
authored
Merge pull request #3234 from MicrosoftDocs/master
10/23/2020 AM Publish
2 parents 59b7c18 + 851f82a commit bf54b40

File tree

6 files changed

+55
-37
lines changed

6 files changed

+55
-37
lines changed

docs/build/pgosweep.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,64 @@
11
---
22
title: "pgosweep"
3-
ms.date: "03/14/2018"
3+
description: "Use the pgosweep command to write profile data to a PGC file for use in profile-guided optimization."
4+
ms.date: 10/23/2020
45
helpviewer_keywords: ["pgosweep program", "profile-guided optimizations, pgosweep"]
5-
ms.assetid: f39dd3b7-1cd9-4c3b-8e8b-fb794744b757
66
---
77
# pgosweep
88

9-
Used in profile-guided optimization to write all profile data from a running program to the .pgc file.
9+
Used in profile-guided optimization to write all profile data from a running program to the PGC file.
1010

1111
## Syntax
1212

13-
> **pgosweep** [*options*] *image* *pgcfile*
13+
> **`pgosweep`** [*options*] *image* *pgcfile*
1414
1515
### Parameters
1616

17-
*options*<br/>
17+
*options*\
1818
(Optional) The valid values for *options* are:
1919

20-
- **/?** or **/help** displays the help message.
20+
- **`/?`** or **`/help`** displays the help message.
2121

22-
- **/noreset** preserves the count in the runtime data structures.
22+
- **`/reset`** resets counts to zero after sweep. This behavior is the default.
2323

24-
*image*<br/>
25-
The full path of an .exe or .dll file that was created by using the [/GENPROFILE](reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md), [/FASTGENPROFILE](reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md), or [/LTCG:PGINSTRUMENT](reference/ltcg-link-time-code-generation.md) option.
24+
- **`/pid:n`** only sweeps the specified PID, where *n* is the PID number.
2625

27-
*pgcfile*<br/>
28-
The .pgc file where this command writes out the data counts.
26+
- **`/wait`** waits for the specified PID to terminate before collecting counts.
27+
28+
- **`/onlyzero`** doesn't save a PGC file, only zero counts.
29+
30+
- **`/pause`** pauses count collection on the system.
31+
32+
- **`/resume`** resumes count collection on the system.
33+
34+
- **`/noreset`** preserves the count in the runtime data structures.
35+
36+
*image*\
37+
The full path of an EXE or DLL file that was created by using the [`/GENPROFILE`](reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md), [`/FASTGENPROFILE`](reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md), or [`/LTCG:PGINSTRUMENT`](reference/ltcg-link-time-code-generation.md) option.
38+
39+
*pgcfile*\
40+
The PGC file where this command writes out the data counts.
2941

3042
## Remarks
3143

32-
The **pgosweep** command works on programs that were built by using the [/GENPROFILE or /FASTGENPROFILE](reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md) option, or the deprecated [/LTCG:PGINSTRUMENT](reference/ltcg-link-time-code-generation.md) option. It interrupts a running program and writes the profile data to a new .pgc file. By default, the command resets counts after each write operation. If you specify the **/noreset** option, the command will record the values, but not reset them in the running program. This option gives you duplicate data if you retrieve the profile data later.
44+
The **`pgosweep`** command works on programs that were built by using the [`/GENPROFILE` or `/FASTGENPROFILE`](reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md) option, or the deprecated [`/LTCG:PGINSTRUMENT`](reference/ltcg-link-time-code-generation.md) option. It interrupts a running program and writes the profile data to a new PGC file. By default, the command resets counts after each write operation. If you specify the **`/noreset`** option, the command will record the values, but not reset them in the running program. This option gives you duplicate data if you retrieve the profile data later.
3345

34-
An alternative use for **pgosweep** is to retrieve profile information just for the normal operation of the application. For example, you could run **pgosweep** shortly after you start the application and discard that file. This would remove profile data associated with startup costs. Then, you can run **pgosweep** before ending the application. Now the collected data has profile information only from the time the user could interact with the program.
46+
An alternative use for **`pgosweep`** is to retrieve profile information just for the normal operation of the application. For example, you could run **`pgosweep`** shortly after you start the application and discard that file. This command would remove profile data associated with startup costs. Then, you can run **`pgosweep`** before ending the application. Now the collected data has profile information only from the time the user could interact with the program.
3547

36-
When you name a .pgc file (by using the *pgcfile* parameter) you can use the standard format, which is *appname!n*.pgc. If you use this format, the compiler automatically finds this data in the **/LTCG /USEPROFILE** or **/LTCG:PGO** phase. If you do not use the standard format, you must use [pgomgr](pgomgr.md) to merge the .pgc files.
48+
When you name a PGC file (by using the *pgcfile* parameter) you can use the standard format, which is *`appname!n.pgc`*. The *n* represents an increasing numeric value for each file. If you use this format, the compiler automatically finds this data in the **`/LTCG /USEPROFILE`** or **`/LTCG:PGO`** phase. If you don't use the standard format, you must use [`pgomgr`](pgomgr.md) to merge the PGC files.
3749

3850
> [!NOTE]
39-
> You can start this tool only from a Visual Studio developer command prompt. You cannot start it from a system command prompt or from File Explorer.
51+
> You can start this tool only from a Visual Studio developer command prompt. You can't start it from a system command prompt or from File Explorer.
4052
41-
For information on how to capture the profile data from within your executable, see [PgoAutoSweep](pgoautosweep.md).
53+
For information on how to capture the profile data from within your executable, see [`PgoAutoSweep`](pgoautosweep.md).
4254

4355
## Example
4456

45-
In this example command, **pgosweep** writes the current profile information for myapp.exe to myapp!1.pgc.
57+
In this example command, **`pgosweep`** writes the current profile information for *`myapp.exe`* to *`myapp!1.pgc`*.
4658

4759
`pgosweep myapp.exe myapp!1.pgc`
4860

4961
## See also
5062

51-
[Profile-Guided Optimizations](profile-guided-optimizations.md)<br/>
52-
[PgoAutoSweep](pgoautosweep.md)<br/>
63+
[Profile-Guided Optimizations](profile-guided-optimizations.md)\
64+
[PgoAutoSweep](pgoautosweep.md)

docs/code-quality/c26400.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
---
22
title: C26400
3-
ms.date: 08/02/2017
4-
ms.topic: "conceptual"
3+
description: "Describes the Microsoft C/C++ code analysis warning C26400, its causes, and how to address it."
4+
ms.date: 10/23/2020
55
f1_keywords: ["C26400"]
66
helpviewer_keywords: ["C26400"]
7-
ms.assetid: b27e1c6d-8b52-40b3-9760-b93afef19c7a
87
---
98
# C26400 NO_RAW_POINTER_ASSIGNMENT
109

11-
This check helps to enforce the *rule I.11: Never transfer ownership by a raw pointer (T\*)*, which is a subset of the rule *R.3: A raw pointer (a T\*) is non-owning.* Specifically, it warns on any call to operator `new` which saves its result in a variable of raw pointer type. It also warns on calls to functions that return `gsl::owner<T>` if their results are assigned to raw pointers. The idea here is that you should clearly state ownership of memory resources. For more information, see the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#r-resource-management).
10+
This check helps to enforce the *rule I.11: Never transfer ownership by a raw pointer (T\*)*, which is a subset of the rule *R.3: A raw pointer (a T\*) is non-owning*. Specifically, it warns on any call to `operator new`, which saves its result in a variable of raw pointer type. It also warns on calls to functions that return `gsl::owner<T>` if their results are assigned to raw pointers. The idea here is that you should clearly state ownership of memory resources. For more information, see the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#r-resource-management).
1211

13-
The easiest way to fix this is to use **`auto`** declaration if the resource is assigned immediately at the variable declaration. If this is not possible, then we suggest that you use the type `gsl::owner<T>`. The **`auto`** declarations initialized with operator **`new`** are "owners" because we assume that the result of any allocation is implicitly an owner pointer. We transfer this assumption to the **`auto`** variable and treat it as `owner<T>`.
12+
The easiest way to fix this warning is to use **`auto`** declaration if the resource is assigned immediately at the variable declaration. If this fix isn't possible, then we suggest that you use the type `gsl::owner<T>`. The **`auto`** declarations initialized with operator **`new`** are "owners" because we assume that the result of any allocation is implicitly an owner pointer. We transfer this assumption to the **`auto`** variable and treat it as `owner<T>`.
1413

15-
If this check flags a call to a function which returns `owner<T>`, this may be an indication of a legitimate bug in code. Basically, it points to a place where the code leaks an explicit notion of ownership (and maybe the resource itself).
14+
If this check flags a call to a function that returns `owner<T>`, it may be an indication of a legitimate bug in the code. Basically, it points to a place where the code leaks an explicit notion of ownership (and maybe the resource itself).
1615

1716
## Remarks
1817

19-
This rule currently checks only local variables. If allocation is assigned to a formal parameter, global variable, class member, and so on, it is not flagged. Appropriate coverage of such scenarios is a part of future work.
18+
This rule currently checks only local variables. If you assign an allocation to a formal parameter, global variable, class member, and so on, it's not flagged. Appropriate coverage of such scenarios is planned for future work.
2019

2120
## Example 1: Simple allocation
2221

@@ -28,15 +27,18 @@ else
2827
buffer = new char[bufferSize]; // C26400
2928
```
3029

31-
## Example 2: Simple allocation (fixed with gsl::owner\<T>)
30+
## Example 2: Simple allocation (fixed with `gsl::owner<T>`)
3231

3332
```cpp
3433
gsl::owner<char*> buffer = nullptr;
3534
if (useCache)
3635
buffer = GetCache();
3736
else
3837
buffer = new char[bufferSize]; // OK
38+
```
39+
40+
## Example 3: Simple allocation (fixed with `auto`)
3941

40-
Example 3: Simple allocation (fixed with auto)
42+
```cpp
4143
auto buffer = useCache ? GetCache() : new char[bufferSize]; // OK
4244
```

docs/code-quality/c28230.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: C28230
3-
ms.date: 11/04/2016
3+
description: "Understand the causes of Microsoft C/C++ code analysis warning C28230, and learn how to fix them."
4+
ms.date: 10/23/2020
45
ms.topic: reference
56
f1_keywords: ["C28230"]
67
helpviewer_keywords: ["C28230"]
@@ -24,7 +25,7 @@ struct MyStruct
2425
};
2526

2627
// Oops, the name of the member is spelled wrong so it will not be found
27-
void f(_Out_writes_(value.usefulMember) int *buffer, MyStruct value)
28+
void f(_Out_writes_(value.usefulmember) int *buffer, MyStruct value)
2829
{
2930
for(int i = 0 ; i < value.usefulMember; i++)
3031
{

docs/code-quality/c6308.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: C6308
3-
ms.date: 11/04/2016
3+
description: "Understand the causes of Microsoft C/C++ code analysis warning C6308, and learn how to fix them."
4+
ms.date: 10/23/2020
45
ms.topic: reference
56
f1_keywords: ["C6308"]
67
helpviewer_keywords: ["C6308"]
@@ -52,6 +53,7 @@ void f()
5253
{
5354
x = tmp;
5455
}
56+
// code...
5557
free(x);
5658
}
5759
}

docs/cppcx/wrl/how-to-create-a-classic-com-component-using-wrl.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: "How to: Create a Classic COM Component Using WRL"
3-
ms.date: "11/04/2016"
3+
description: "Use the Windows Runtime C++ Template Library (WRL) to create basic classic COM components for use in desktop apps."
4+
ms.date: 10/23/2020
45
ms.topic: "reference"
5-
ms.assetid: 5efe7690-90d5-4c3c-9e53-11a14cefcb19
66
---
77
# How to: Create a Classic COM Component Using WRL
88

@@ -30,7 +30,7 @@ This document shows how to use the Windows Runtime C++ Template Library to creat
3030

3131
[!code-cpp[wrl-classic-com-component#3](../codesnippet/CPP/how-to-create-a-classic-com-component-using-wrl_3.cpp)]
3232

33-
7. Add a **Module-Definition File (.def)** file to the project. Name the file, for example, `CalculatorComponent.def`. This file gives the linker the names of the functions to be exported.
33+
7. Add a **Module-Definition File (.def)** file to the project. Name the file, for example, `CalculatorComponent.def`. This file gives the linker the names of the functions to be exported. Open the **Property Pages** dialog for your project, then under **Configuration Properties** > **Linker** > **Input**, set the **Module Definition File** property to your DEF file.
3434

3535
8. Add this code to CalculatorComponent.def:
3636

@@ -43,7 +43,7 @@ This document shows how to use the Windows Runtime C++ Template Library to creat
4343
DllCanUnloadNow PRIVATE
4444
```
4545
46-
9. Add runtimeobject.lib to the linker line. To learn how, see [.Lib Files as Linker Input](../../build/reference/dot-lib-files-as-linker-input.md).
46+
9. Add runtimeobject.lib to the linker line. To learn how, see [`.Lib` Files as Linker Input](../../build/reference/dot-lib-files-as-linker-input.md).
4747
4848
### To consume the COM component from a desktop app
4949

docs/windows/universal-crt-deployment.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
22
title: "Universal CRT deployment"
3-
ms.date: "05/11/2018"
3+
description: "Learn how, when, and where to deploy the Universal CRT library for your app."
4+
ms.date: 10/23/2020
45
helpviewer_keywords: ["deploying the CRT [C++]", "application CRT deployment [C++]"]
56
---
67
# Universal CRT deployment
78

89
From Visual Studio .NET through Visual Studio 2013, each major release of the C++ compiler and tools has included a new, standalone version of the Microsoft C Runtime (CRT) library. These standalone versions of the CRT were independent from, and to various degrees, incompatible with each other. For example, the CRT library used by Visual Studio 2012 was version 11, named msvcr110.dll, and the CRT used by Visual Studio 2013 was version 12, named msvcr120.dll. Beginning in Visual Studio 2015, it's no longer the case. Visual Studio 2015 and later versions of Visual Studio all use one Universal CRT.
910

10-
The Universal CRT is a Microsoft Windows operating system component included as part of the operating system in Windows 10. It's available for older operating systems, Windows Vista through Windows 8.1, by using Windows Update. Local deployment of the Universal CRT is supported, with some restrictions.
11+
The Universal CRT (UCRT) is a Microsoft Windows operating system component. It's included as part of the operating system in Windows 10 and Windows Server 2016 or later. The UCRT is available by using Windows Update on older operating systems that are still in extended support. Local deployment of the Universal CRT is supported, with some restrictions.
1112

1213
## Central deployment
1314

0 commit comments

Comments
 (0)