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
The **allocator** declaration specifier can be applied to custom memory-allocation functions to make the allocations visible via Event Tracing for Windows (ETW).
12
+
13
+
## Syntax
14
+
15
+
```
16
+
__declspec(allocator)
17
+
```
18
+
19
+
## Remarks
20
+
21
+
The native memory profiler in Visual Studio works by collecting allocation ETW event data emitted by during runtime. Allocators in the CRT and Windows SDK have been annotated at the source level so that their allocation data can be captured. If you are writing your own allocators, then any functions that return a pointer to newly allocated heap memory can be decorated with `__declspec(allocator)`, as seen in this example for myMalloc:
22
+
23
+
```cpp
24
+
__declspec(allocator) void* myMalloc(size_t size)
25
+
```
26
+
27
+
For more information, see [Measure memory usage in Visual Studio](/visualstudio/profiling/memory-usage) and [Custom native ETW heap events](/visualstudio/profiling/custom-native-etw-heap-events).
@@ -45,7 +46,7 @@ The extended attribute syntax for specifying storage-class information uses the
45
46
46
47
White space separates the declaration modifier sequence. Examples appear in later sections.
47
48
48
-
Extended attribute grammar supports these Microsoft-specific storage-class attributes: [align](../cpp/align-cpp.md), [allocate](../cpp/allocate.md), [appdomain](../cpp/appdomain.md), [code_seg](../cpp/code-seg-declspec.md), [deprecated](../cpp/deprecated-cpp.md), [dllexport](../cpp/dllexport-dllimport.md), [dllimport](../cpp/dllexport-dllimport.md), [jitintrinsic](../cpp/jitintrinsic.md), [naked](../cpp/naked-cpp.md), [noalias](../cpp/noalias.md), [noinline](../cpp/noinline.md), [noreturn](../cpp/noreturn.md), [nothrow](../cpp/nothrow-cpp.md), [novtable](../cpp/novtable.md), [process](../cpp/process.md), [restrict](../cpp/restrict.md), [safebuffers](../cpp/safebuffers.md), [selectany](../cpp/selectany.md), [spectre](../cpp/spectre.md), and [thread](../cpp/thread.md). It also supports these COM-object attributes: [property](../cpp/property-cpp.md) and [uuid](../cpp/uuid-cpp.md).
49
+
Extended attribute grammar supports these Microsoft-specific storage-class attributes: [align](../cpp/align-cpp.md), [allocate](../cpp/allocate.md), [allocator](../cpp/allocator.md), [appdomain](../cpp/appdomain.md), [code_seg](../cpp/code-seg-declspec.md), [deprecated](../cpp/deprecated-cpp.md), [dllexport](../cpp/dllexport-dllimport.md), [dllimport](../cpp/dllexport-dllimport.md), [jitintrinsic](../cpp/jitintrinsic.md), [naked](../cpp/naked-cpp.md), [noalias](../cpp/noalias.md), [noinline](../cpp/noinline.md), [noreturn](../cpp/noreturn.md), [nothrow](../cpp/nothrow-cpp.md), [novtable](../cpp/novtable.md), [process](../cpp/process.md), [restrict](../cpp/restrict.md), [safebuffers](../cpp/safebuffers.md), [selectany](../cpp/selectany.md), [spectre](../cpp/spectre.md), and [thread](../cpp/thread.md). It also supports these COM-object attributes: [property](../cpp/property-cpp.md) and [uuid](../cpp/uuid-cpp.md).
49
50
50
51
The **code_seg**, **dllexport**, **dllimport**, **naked**, **noalias**, **nothrow**, **property**, **restrict**, **selectany**, **thread**, and **uuid** storage-class attributes are properties only of the declaration of the object or function to which they are applied. The **thread** attribute affects data and objects only. The **naked** and **spectre** attributes affect functions only. The **dllimport** and **dllexport** attributes affect functions, data, and objects. The **property**, **selectany**, and **uuid** attributes affect COM objects.
Copy file name to clipboardExpand all lines: docs/mfc/reference/cedit-class.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -474,11 +474,11 @@ UINT GetLimitText() const;
474
474
475
475
### Return Value
476
476
477
-
The current text limit, in bytes, for this `CEdit` object.
477
+
The current text limit, in TCHARs, for this `CEdit` object.
478
478
479
479
### Remarks
480
480
481
-
The text limit is the maximum amount of text, in bytes, that the edit control can accept.
481
+
The text limit is the maximum amount of text, in TCHARs, that the edit control can accept.
482
482
483
483
> [!NOTE]
484
484
> This member function is available beginning with Windows 95 and Windows NT 4.0.
@@ -510,14 +510,14 @@ int GetLine(
510
510
Specifies the line number to retrieve from a multiple-line edit control. Line numbers are zero-based; a value of 0 specifies the first line. This parameter is ignored by a single-line edit control.
511
511
512
512
*lpszBuffer*<br/>
513
-
Points to the buffer that receives a copy of the line. The first word of the buffer must specify the maximum number of characters that can be copied to the buffer.
513
+
Points to the buffer that receives a copy of the line. The first word of the buffer must specify the maximum number of TCHARs that can be copied to the buffer.
514
514
515
515
*nMaxLength*<br/>
516
-
Specifies the maximum number of bytes that can be copied to the buffer. `GetLine` places this value in the first word of *lpszBuffer* before making the call to Windows.
516
+
Specifies the maximum number of TCHAR characters that can be copied to the buffer. `GetLine` places this value in the first word of *lpszBuffer* before making the call to Windows.
517
517
518
518
### Return Value
519
519
520
-
The number of bytes actually copied. The return value is 0 if the line number specified by *nIndex* is greater than the number of lines in the edit control.
520
+
The number of characters actually copied. The return value is 0 if the line number specified by *nIndex* is greater than the number of lines in the edit control.
Specifies the length (in bytes) of the text that the user can enter. If this parameter is 0, the text length is set to UINT_MAX bytes. This is the default behavior.
707
+
Specifies the length (in TCHARs) of the text that the user can enter. If this parameter is 0, the text length is set to UINT_MAX bytes. This is the default behavior.
0 commit comments