-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
NativeMemory.xml
656 lines (594 loc) · 35.6 KB
/
NativeMemory.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
<Type Name="NativeMemory" FullName="System.Runtime.InteropServices.NativeMemory">
<TypeSignature Language="C#" Value="public static class NativeMemory" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit NativeMemory extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Runtime.InteropServices.NativeMemory" />
<TypeSignature Language="VB.NET" Value="Public Class NativeMemory" />
<TypeSignature Language="F#" Value="type NativeMemory = class" />
<TypeSignature Language="C++ CLI" Value="public ref class NativeMemory abstract sealed" />
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>This class contains methods that are mainly used to manage native memory.</summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
<Member MemberName="AlignedAlloc">
<MemberSignature Language="C#" Value="public static void* AlignedAlloc (nuint byteCount, nuint alignment);" FrameworkAlternate="net-6.0" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void* AlignedAlloc(native unsigned int byteCount, native unsigned int alignment) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.AlignedAlloc(System.UIntPtr,System.UIntPtr)" />
<MemberSignature Language="F#" Value="static member AlignedAlloc : unativeint * unativeint -> nativeptr<unit>" Usage="System.Runtime.InteropServices.NativeMemory.AlignedAlloc (byteCount, alignment)" />
<MemberSignature Language="C++ CLI" Value="public:
 static void* AlignedAlloc(UIntPtr byteCount, UIntPtr alignment);" />
<MemberSignature Language="C#" Value="public static void* AlignedAlloc (UIntPtr byteCount, UIntPtr alignment);" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void*</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="byteCount" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="alignment" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="byteCount">The size, in bytes, of the block to allocate.</param>
<param name="alignment">The alignment, in bytes, of the block to allocate. This must be a power of <c>2</c>.</param>
<summary>Allocates an aligned block of memory of the specified size and alignment, in bytes.</summary>
<returns>A pointer to the allocated aligned block of memory.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method allows `byteCount` to be `0` and will return a valid pointer that should not be dereferenced and that should be passed to free to avoid memory leaks.
This method is a thin wrapper over the C `aligned_alloc` API or a platform dependent aligned allocation API such as `_aligned_malloc` on Win32.
This method is not compatible with <xref:System.Runtime.InteropServices.NativeMemory.Free(System.Void*)> or <xref:System.Runtime.InteropServices.NativeMemory.Realloc(System.Void*,System.UIntPtr)>. Instead, call <xref:System.Runtime.InteropServices.NativeMemory.AlignedFree(System.Void*)> or <xref:System.Runtime.InteropServices.NativeMemory.AlignedRealloc(System.Void*,System.UIntPtr,System.UIntPtr)>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="alignment" /> is not a power of two.</exception>
<exception cref="T:System.OutOfMemoryException">Allocating <paramref name="byteCount" /> of memory with <paramref name="alignment" /> failed.</exception>
</Docs>
</Member>
<Member MemberName="AlignedFree">
<MemberSignature Language="C#" Value="public static void AlignedFree (void* ptr);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void AlignedFree(void* ptr) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.AlignedFree(System.Void*)" />
<MemberSignature Language="F#" Value="static member AlignedFree : nativeptr<unit> -> unit" Usage="System.Runtime.InteropServices.NativeMemory.AlignedFree ptr" />
<MemberSignature Language="C++ CLI" Value="public:
 static void AlignedFree(void* ptr);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ptr" Type="System.Void*" />
</Parameters>
<Docs>
<param name="ptr">A pointer to the aligned block of memory that should be freed.</param>
<summary>Frees an aligned block of memory.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method does nothing if `ptr` is `null`.
This method is a thin wrapper over the C `free` API or a platform dependent aligned free API such as `_aligned_free` on Win32.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AlignedRealloc">
<MemberSignature Language="C#" Value="public static void* AlignedRealloc (void* ptr, nuint byteCount, nuint alignment);" FrameworkAlternate="net-6.0" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void* AlignedRealloc(void* ptr, native unsigned int byteCount, native unsigned int alignment) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.AlignedRealloc(System.Void*,System.UIntPtr,System.UIntPtr)" />
<MemberSignature Language="F#" Value="static member AlignedRealloc : nativeptr<unit> * unativeint * unativeint -> nativeptr<unit>" Usage="System.Runtime.InteropServices.NativeMemory.AlignedRealloc (ptr, byteCount, alignment)" />
<MemberSignature Language="C++ CLI" Value="public:
 static void* AlignedRealloc(void* ptr, UIntPtr byteCount, UIntPtr alignment);" />
<MemberSignature Language="C#" Value="public static void* AlignedRealloc (void* ptr, UIntPtr byteCount, UIntPtr alignment);" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void*</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ptr" Type="System.Void*" />
<Parameter Name="byteCount" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="alignment" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="ptr">The previously allocated block of memory.</param>
<param name="byteCount">The size, in bytes, of the block to allocate.</param>
<param name="alignment">The alignment, in bytes, of the block to allocate. This must be a power of <c>2</c>.</param>
<summary>Reallocates an aligned block of memory of the specified size and alignment, in bytes.</summary>
<returns>A pointer to the reallocated aligned block of memory.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method acts as <xref:System.Runtime.InteropServices.NativeMemory.AlignedAlloc(System.UIntPtr,System.UIntPtr)> if `ptr` is `null`.
This method allows `byteCount` to be `0` and will return a valid pointer that should not be dereferenced and that should be passed to free to avoid memory leaks.
This method is a platform dependent aligned reallocation API such as `_aligned_realloc` on Win32.
This method is not compatible with <xref:System.Runtime.InteropServices.NativeMemory.Free(System.Void*)> or <xref:System.Runtime.InteropServices.NativeMemory.Realloc(System.Void*,System.UIntPtr)>. Instead, call <xref:System.Runtime.InteropServices.NativeMemory.AlignedFree(System.Void*)> or <xref:System.Runtime.InteropServices.NativeMemory.AlignedRealloc(System.Void*,System.UIntPtr,System.UIntPtr)>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="alignment" /> is not a power of two.</exception>
<exception cref="T:System.OutOfMemoryException">Reallocating <paramref name="byteCount" /> of memory with <paramref name="alignment" /> failed.</exception>
</Docs>
</Member>
<Member MemberName="Alloc">
<MemberSignature Language="C#" Value="public static void* Alloc (nuint byteCount);" FrameworkAlternate="net-6.0" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void* Alloc(native unsigned int byteCount) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.Alloc(System.UIntPtr)" />
<MemberSignature Language="F#" Value="static member Alloc : unativeint -> nativeptr<unit>" Usage="System.Runtime.InteropServices.NativeMemory.Alloc byteCount" />
<MemberSignature Language="C++ CLI" Value="public:
 static void* Alloc(UIntPtr byteCount);" />
<MemberSignature Language="C#" Value="public static void* Alloc (UIntPtr byteCount);" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void*</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="byteCount" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="byteCount">The size, in bytes, of the block to allocate.</param>
<summary>Allocates a block of memory of the specified size, in bytes.</summary>
<returns>A pointer to the allocated block of memory.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method allows `byteCount` to be `0` and will return a valid pointer that should not be dereferenced and that should be passed to free to avoid memory leaks.
This method is a thin wrapper over the C `malloc` API.
]]></format>
</remarks>
<exception cref="T:System.OutOfMemoryException">Allocating <paramref name="byteCount" /> of memory failed.</exception>
</Docs>
</Member>
<Member MemberName="Alloc">
<MemberSignature Language="C#" Value="public static void* Alloc (nuint elementCount, nuint elementSize);" FrameworkAlternate="net-6.0" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void* Alloc(native unsigned int elementCount, native unsigned int elementSize) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.Alloc(System.UIntPtr,System.UIntPtr)" />
<MemberSignature Language="F#" Value="static member Alloc : unativeint * unativeint -> nativeptr<unit>" Usage="System.Runtime.InteropServices.NativeMemory.Alloc (elementCount, elementSize)" />
<MemberSignature Language="C++ CLI" Value="public:
 static void* Alloc(UIntPtr elementCount, UIntPtr elementSize);" />
<MemberSignature Language="C#" Value="public static void* Alloc (UIntPtr elementCount, UIntPtr elementSize);" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void*</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="elementCount" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="elementSize" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="elementCount">The count, in elements, of the block to allocate.</param>
<param name="elementSize">The size, in bytes, of each element in the allocation.</param>
<summary>Allocates a block of memory of the specified size, in elements.</summary>
<returns>A pointer to the allocated block of memory.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method allows `elementCount` and/or `elementSize` to be `0` and will return a valid pointer that should not be dereferenced and that should be passed to free to avoid memory leaks.
This method is a thin wrapper over the C `malloc` API.
]]></format>
</remarks>
<exception cref="T:System.OutOfMemoryException">Allocating <paramref name="elementCount" /> * <paramref name="elementSize" /> bytes of memory failed.</exception>
</Docs>
</Member>
<Member MemberName="AllocZeroed">
<MemberSignature Language="C#" Value="public static void* AllocZeroed (nuint byteCount);" FrameworkAlternate="net-6.0" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void* AllocZeroed(native unsigned int byteCount) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.AllocZeroed(System.UIntPtr)" />
<MemberSignature Language="F#" Value="static member AllocZeroed : unativeint -> nativeptr<unit>" Usage="System.Runtime.InteropServices.NativeMemory.AllocZeroed byteCount" />
<MemberSignature Language="C++ CLI" Value="public:
 static void* AllocZeroed(UIntPtr byteCount);" />
<MemberSignature Language="C#" Value="public static void* AllocZeroed (UIntPtr byteCount);" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void*</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="byteCount" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="byteCount">The size, in bytes, of the block to allocate.</param>
<summary>Allocates and zeroes a block of memory of the specified size, in bytes.</summary>
<returns>A pointer to the allocated and zeroed block of memory.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method allows `byteCount` to be `0` and will return a valid pointer that should not be dereferenced and that should be passed to free to avoid memory leaks.
This method is a thin wrapper over the C `calloc` API.
]]></format>
</remarks>
<exception cref="T:System.OutOfMemoryException">Allocating <paramref name="byteCount" /> of memory failed.</exception>
</Docs>
</Member>
<Member MemberName="AllocZeroed">
<MemberSignature Language="C#" Value="public static void* AllocZeroed (nuint elementCount, nuint elementSize);" FrameworkAlternate="net-6.0" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void* AllocZeroed(native unsigned int elementCount, native unsigned int elementSize) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.AllocZeroed(System.UIntPtr,System.UIntPtr)" />
<MemberSignature Language="F#" Value="static member AllocZeroed : unativeint * unativeint -> nativeptr<unit>" Usage="System.Runtime.InteropServices.NativeMemory.AllocZeroed (elementCount, elementSize)" />
<MemberSignature Language="C++ CLI" Value="public:
 static void* AllocZeroed(UIntPtr elementCount, UIntPtr elementSize);" />
<MemberSignature Language="C#" Value="public static void* AllocZeroed (UIntPtr elementCount, UIntPtr elementSize);" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void*</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="elementCount" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
<Parameter Name="elementSize" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="elementCount">The count, in elements, of the block to allocate.</param>
<param name="elementSize">The size, in bytes, of each element in the allocation.</param>
<summary>Allocates and zeroes a block of memory of the specified size, in elements.</summary>
<returns>A pointer to the allocated and zeroed block of memory.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method allows `elementCount` and `elementSize` to be `0`. It returns a valid pointer that should not be dereferenced and that should be passed to free to avoid memory leaks.
This method is a thin wrapper over the C `calloc` API.
]]></format>
</remarks>
<exception cref="T:System.OutOfMemoryException">Allocating <paramref name="elementCount" /> * <paramref name="elementSize" /> bytes of memory failed.</exception>
</Docs>
</Member>
<Member MemberName="Clear">
<MemberSignature Language="C#" Value="public static void Clear (void* ptr, UIntPtr byteCount);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Clear(void* ptr, native unsigned int byteCount) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.Clear(System.Void*,System.UIntPtr)" />
<MemberSignature Language="F#" Value="static member Clear : nativeptr<unit> * unativeint -> unit" Usage="System.Runtime.InteropServices.NativeMemory.Clear (ptr, byteCount)" />
<MemberSignature Language="C++ CLI" Value="public:
 static void Clear(void* ptr, UIntPtr byteCount);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-7.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ptr" Type="System.Void*" Index="0" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<Parameter Name="byteCount" Type="System.UIntPtr" Index="1" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
</Parameters>
<Docs>
<param name="ptr">A pointer to the block of memory that should be cleared.</param>
<param name="byteCount">The size, in bytes, of the block to clear.</param>
<summary>Clears a block of memory.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If this method is called with `ptr` being `null` and `byteCount` being `0`, it will be equivalent to a no-op.
The behavior when `ptr` is `null` and `byteCount` is greater than `0` is undefined.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Copy">
<MemberSignature Language="C#" Value="public static void Copy (void* source, void* destination, UIntPtr byteCount);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Copy(void* source, void* destination, native unsigned int byteCount) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.Copy(System.Void*,System.Void*,System.UIntPtr)" />
<MemberSignature Language="F#" Value="static member Copy : nativeptr<unit> * nativeptr<unit> * unativeint -> unit" Usage="System.Runtime.InteropServices.NativeMemory.Copy (source, destination, byteCount)" />
<MemberSignature Language="C++ CLI" Value="public:
 static void Copy(void* source, void* destination, UIntPtr byteCount);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-7.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Void*" Index="0" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<Parameter Name="destination" Type="System.Void*" Index="1" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<Parameter Name="byteCount" Type="System.UIntPtr" Index="2" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
</Parameters>
<Docs>
<param name="source">A pointer to the source of data to be copied.</param>
<param name="destination">A pointer to the destination memory block where the data is to be copied.</param>
<param name="byteCount">The size, in bytes, to be copied from the source location to the destination.</param>
<summary>Copies a block of memory from memory location <paramref name="source" /> to memory location <paramref name="destination" />.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Fill">
<MemberSignature Language="C#" Value="public static void Fill (void* ptr, UIntPtr byteCount, byte value);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Fill(void* ptr, native unsigned int byteCount, unsigned int8 value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.Fill(System.Void*,System.UIntPtr,System.Byte)" />
<MemberSignature Language="F#" Value="static member Fill : nativeptr<unit> * unativeint * byte -> unit" Usage="System.Runtime.InteropServices.NativeMemory.Fill (ptr, byteCount, value)" />
<MemberSignature Language="C++ CLI" Value="public:
 static void Fill(void* ptr, UIntPtr byteCount, System::Byte value);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-7.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ptr" Type="System.Void*" Index="0" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<Parameter Name="byteCount" Type="System.UIntPtr" Index="1" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<Parameter Name="value" Type="System.Byte" Index="2" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
</Parameters>
<Docs>
<param name="ptr">A pointer to the block of memory to fill.</param>
<param name="byteCount">The number of bytes to be set to <paramref name="value" />.</param>
<param name="value">The value to be set.</param>
<summary>Copies the byte <paramref name="value" /> to the first <paramref name="byteCount" /> bytes of the memory located at <paramref name="ptr" />.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Free">
<MemberSignature Language="C#" Value="public static void Free (void* ptr);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Free(void* ptr) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.Free(System.Void*)" />
<MemberSignature Language="F#" Value="static member Free : nativeptr<unit> -> unit" Usage="System.Runtime.InteropServices.NativeMemory.Free ptr" />
<MemberSignature Language="C++ CLI" Value="public:
 static void Free(void* ptr);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ptr" Type="System.Void*" />
</Parameters>
<Docs>
<param name="ptr">A pointer to the block of memory that should be freed.</param>
<summary>Frees a block of memory.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method does nothing if `ptr` is `null`.
This method is a thin wrapper over the C `free` API.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Realloc">
<MemberSignature Language="C#" Value="public static void* Realloc (void* ptr, nuint byteCount);" FrameworkAlternate="net-6.0" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void* Realloc(void* ptr, native unsigned int byteCount) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.NativeMemory.Realloc(System.Void*,System.UIntPtr)" />
<MemberSignature Language="F#" Value="static member Realloc : nativeptr<unit> * unativeint -> nativeptr<unit>" Usage="System.Runtime.InteropServices.NativeMemory.Realloc (ptr, byteCount)" />
<MemberSignature Language="C++ CLI" Value="public:
 static void* Realloc(void* ptr, UIntPtr byteCount);" />
<MemberSignature Language="C#" Value="public static void* Realloc (void* ptr, UIntPtr byteCount);" FrameworkAlternate="net-7.0;net-8.0;net-9.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.CLSCompliant(false)]</AttributeName>
<AttributeName Language="F#">[<System.CLSCompliant(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void*</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ptr" Type="System.Void*" />
<Parameter Name="byteCount" Type="System.UIntPtr">
<Attributes>
<Attribute FrameworkAlternate="net-6.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NativeInteger]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NativeInteger>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="ptr">The previously allocated block of memory.</param>
<param name="byteCount">The size, in bytes, of the reallocated block.</param>
<summary>Reallocates a block of memory to be the specified size, in bytes.</summary>
<returns>A pointer to the reallocated block of memory.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method acts as <xref:System.Runtime.InteropServices.NativeMemory.Alloc(System.UIntPtr,System.UIntPtr)> if `ptr` is `null`.
This method allows `byteCount` to be `0` and will return a valid pointer that should not be dereferenced and that should be passed to free to avoid memory leaks.
This method is a thin wrapper over the C `realloc` API.
]]></format>
</remarks>
<exception cref="T:System.OutOfMemoryException">Reallocating <paramref name="byteCount" /> of memory failed.</exception>
</Docs>
</Member>
</Members>
</Type>