Skip to content

Commit 859c4f0

Browse files
author
Colin Robertson
authored
Merge pull request #3659 from MicrosoftDocs/main637782140368026133
Repo sync for protected CLA branch
2 parents 1111e57 + 6f113e7 commit 859c4f0

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

docs/atl/reference/ccomheap-class.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,39 @@ f1_keywords: ["CComHeap", "ATLCOMMEM/ATL::CComHeap", "ATLCOMMEM/ATL::CComHeap::A
66
helpviewer_keywords: ["CComHeap class"]
77
ms.assetid: c74183ce-98ae-46fb-b186-93ea4cf0222b
88
---
9-
# CComHeap Class
9+
# `CComHeap` Class
1010

11-
This class implements [IAtlMemMgr](../../atl/reference/iatlmemmgr-class.md) using the COM memory allocation functions.
11+
This class implements [`IAtlMemMgr`](../../atl/reference/iatlmemmgr-class.md) using the COM memory allocation functions.
1212

1313
> [!IMPORTANT]
1414
> This class and its members cannot be used in applications that execute in the Windows Runtime.
1515
1616
## Syntax
1717

18-
```
18+
```cpp
1919
class CComHeap : public IAtlMemMgr
2020
```
2121
2222
## Members
2323
24-
### Public Methods
24+
### Public methods
2525
2626
|Name|Description|
2727
|----------|-----------------|
28-
|[CComHeap::Allocate](#allocate)|Call this method to allocate a block of memory.|
29-
|[CComHeap::Free](#free)|Call this method to free a block of memory allocated by this memory manager.|
30-
|[CComHeap::GetSize](#getsize)|Call this method to get the allocated size of a memory block allocated by this memory manager.|
31-
|[CComHeap::Reallocate](#reallocate)|Call this method to reallocate memory allocated by this memory manager.|
28+
|[`CComHeap::Allocate`](#allocate)|Call this method to allocate a block of memory.|
29+
|[`CComHeap::Free`](#free)|Call this method to free a block of memory allocated by this memory manager.|
30+
|[`CComHeap::GetSize`](#getsize)|Call this method to get the allocated size of a memory block allocated by this memory manager.|
31+
|[`CComHeap::Reallocate`](#reallocate)|Call this method to reallocate memory allocated by this memory manager.|
3232
3333
## Remarks
3434
35-
`CComHeap` implements memory allocation functions using the COM allocation functions, including [CoTaskMemAlloc](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemalloc), [CoTaskMemFree](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemfree), [IMalloc::GetSize](/windows/win32/api/objidlbase/nf-objidlbase-imalloc-getsize), and [CoTaskMemRealloc](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemrealloc). The maximum amount of memory that can be allocated is equal to INT_MAX (2147483647) bytes.
35+
`CComHeap` implements memory allocation functions using the COM allocation functions, including [`CoTaskMemAlloc`](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemalloc), [`CoTaskMemFree`](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemfree), [`IMalloc::GetSize`](/windows/win32/api/objidlbase/nf-objidlbase-imalloc-getsize), and [`CoTaskMemRealloc`](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemrealloc). The maximum amount of memory that can be allocated is equal to `INT_MAX` (2147483647) bytes.
3636
3737
## Example
3838
39-
See the example for [IAtlMemMgr](../../atl/reference/iatlmemmgr-class.md).
39+
See the example for [`IAtlMemMgr`](../../atl/reference/iatlmemmgr-class.md).
4040
41-
## Inheritance Hierarchy
41+
## Inheritance hierarchy
4242
4343
`IAtlMemMgr`
4444
@@ -52,95 +52,95 @@ See the example for [IAtlMemMgr](../../atl/reference/iatlmemmgr-class.md).
5252
5353
Call this method to allocate a block of memory.
5454
55-
```
55+
```cpp
5656
virtual __declspec(allocator) void* Allocate(size_t nBytes) throw();
5757
```
5858

5959
### Parameters
6060

61-
*nBytes*<br/>
61+
*`nBytes`*\
6262
The requested number of bytes in the new memory block.
6363

64-
### Return Value
64+
### Return value
6565

6666
Returns a pointer to the start of the newly allocated memory block.
6767

6868
### Remarks
6969

70-
Call [CComHeap::Free](#free) or [CComHeap::Reallocate](#reallocate) to free the memory allocated by this method.
70+
Call [`CComHeap::Free`](#free) or [`CComHeap::Reallocate`](#reallocate) to free the memory allocated by this method.
7171

72-
Implemented using [CoTaskMemAlloc](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemalloc).
72+
Implemented using [`CoTaskMemAlloc`](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemalloc).
7373

7474
## <a name="free"></a> CComHeap::Free
7575

7676
Call this method to free a block of memory allocated by this memory manager.
7777

78-
```
78+
```cpp
7979
virtual void Free(void* p) throw();
8080
```
8181
8282
### Parameters
8383
84-
*p*<br/>
84+
*`p`*\
8585
Pointer to memory previously allocated by this memory manager. NULL is a valid value and does nothing.
8686
8787
### Remarks
8888
89-
Implemented using [CoTaskMemFree](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemfree).
89+
Implemented using [`CoTaskMemFree`](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemfree).
9090
9191
## <a name="getsize"></a> CComHeap::GetSize
9292
9393
Call this method to get the allocated size of a memory block allocated by this memory manager.
9494
95-
```
95+
```cpp
9696
virtual size_t GetSize(void* p) throw();
9797
```
9898

9999
### Parameters
100100

101-
*p*<br/>
101+
*`p`*\
102102
Pointer to memory previously allocated by this memory manager.
103103

104-
### Return Value
104+
### Return value
105105

106106
Returns the size of the allocated memory block in bytes.
107107

108108
### Remarks
109109

110-
Implemented using [IMalloc::GetSize](/windows/win32/api/objidlbase/nf-objidlbase-imalloc-getsize).
110+
Implemented using [`IMalloc::GetSize`](/windows/win32/api/objidlbase/nf-objidlbase-imalloc-getsize).
111111

112112
## <a name="reallocate"></a> CComHeap::Reallocate
113113

114114
Call this method to reallocate memory allocated by this memory manager.
115115

116-
```
116+
```cpp
117117
virtual __declspec(allocator) void* Reallocate(void* p, size_t nBytes) throw();
118118
```
119119
120120
### Parameters
121121
122-
*p*<br/>
122+
*`p`*\
123123
Pointer to memory previously allocated by this memory manager.
124124
125-
*nBytes*<br/>
125+
*`nBytes`*\
126126
The requested number of bytes in the new memory block.
127127
128-
### Return Value
128+
### Return value
129129
130130
Returns a pointer to the start of the newly allocated memory block.
131131
132132
### Remarks
133133
134-
Call [CComHeap::Free](#free) to free the memory allocated by this method.
134+
Call [`CComHeap::Free`](#free) to free the memory allocated by this method.
135135
136-
Implemented using [CoTaskMemRealloc](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemrealloc).
136+
Implemented using [`CoTaskMemRealloc`](/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemrealloc).
137137
138138
## See also
139139
140-
[DynamicConsumer Sample](../../overview/visual-cpp-samples.md)<br/>
141-
[Class Overview](../../atl/atl-class-overview.md)<br/>
142-
[CWin32Heap Class](../../atl/reference/cwin32heap-class.md)<br/>
143-
[CLocalHeap Class](../../atl/reference/clocalheap-class.md)<br/>
144-
[CGlobalHeap Class](../../atl/reference/cglobalheap-class.md)<br/>
145-
[CCRTHeap Class](../../atl/reference/ccrtheap-class.md)<br/>
146-
[IAtlMemMgr Class](../../atl/reference/iatlmemmgr-class.md)
140+
[DynamicConsumer Sample](../../overview/visual-cpp-samples.md)\
141+
[Class Overview](../../atl/atl-class-overview.md)\
142+
[`CWin32Heap` Class](../../atl/reference/cwin32heap-class.md)\
143+
[`CLocalHeap` Class](../../atl/reference/clocalheap-class.md)\
144+
[`CGlobalHeap` Class](../../atl/reference/cglobalheap-class.md)\
145+
[`CCRTHeap` Class](../../atl/reference/ccrtheap-class.md)\
146+
[`IAtlMemMgr` Class](../../atl/reference/iatlmemmgr-class.md)

0 commit comments

Comments
 (0)