161 references to NativeMemory
ILCompiler.Diagnostics (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Microsoft.DiaSymReader.ISymNGenWriter2.cs (1)
33
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
ILCompiler.ReadyToRun (8)
parent\parent\Common\JitInterface\CorInfoImpl.cs (8)
2396
return
NativeMemory
.Alloc(sz);
2403
NativeMemory
.Free(obj);
3473
NativeMemory
.Free(inlineTree);
3474
NativeMemory
.Free(mappings);
3481
NativeMemory
.Free(suspensionPoints);
3482
NativeMemory
.Free(vars);
3495
return
NativeMemory
.Alloc(cBytes);
3502
NativeMemory
.Free(array);
ILCompiler.RyuJit (8)
parent\parent\Common\JitInterface\CorInfoImpl.cs (8)
2396
return
NativeMemory
.Alloc(sz);
2403
NativeMemory
.Free(obj);
3473
NativeMemory
.Free(inlineTree);
3474
NativeMemory
.Free(mappings);
3481
NativeMemory
.Free(suspensionPoints);
3482
NativeMemory
.Free(vars);
3495
return
NativeMemory
.Alloc(cBytes);
3502
NativeMemory
.Free(array);
libmscordaccore_universal (12)
Entrypoints.cs (12)
87
byte* alignedBuffer = (byte*)
NativeMemory
.AlignedAlloc((nuint)context.Length, ContextAlignment);
95
NativeMemory
.AlignedFree(alignedBuffer);
126
byte* alignedBuffer = (byte*)
NativeMemory
.AlignedAlloc((nuint)buffer.Length, ContextAlignment);
127
NativeMemory
.Clear(alignedBuffer, (nuint)buffer.Length);
139
NativeMemory
.AlignedFree(alignedBuffer);
451
byte* alignedBuffer = (byte*)
NativeMemory
.AlignedAlloc((nuint)context.Length, ContextAlignment);
459
NativeMemory
.AlignedFree(alignedBuffer);
524
byte* alignedBuffer = (byte*)
NativeMemory
.AlignedAlloc((nuint)bufferToFill.Length, ContextAlignment);
525
NativeMemory
.Clear(alignedBuffer, (nuint)bufferToFill.Length);
541
NativeMemory
.AlignedFree(alignedBuffer);
557
byte* alignedBuffer = (byte*)
NativeMemory
.AlignedAlloc((nuint)context.Length, ContextAlignment);
565
NativeMemory
.AlignedFree(alignedBuffer);
Microsoft.AspNetCore.Server.HttpSys (2)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (2)
112
NativeMemory
.Free(curr);
159
var newBlock = (void**)
NativeMemory
.Alloc((nuint)(size + sizeof(void*)));
Microsoft.AspNetCore.Server.IIS (2)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (2)
112
NativeMemory
.Free(curr);
159
var newBlock = (void**)
NativeMemory
.Alloc((nuint)(size + sizeof(void*)));
Microsoft.AspNetCore.Server.Kestrel.Core (2)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (2)
112
NativeMemory
.Free(curr);
159
var newBlock = (void**)
NativeMemory
.Alloc((nuint)(size + sizeof(void*)));
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (2)
112
NativeMemory
.Free(curr);
159
var newBlock = (void**)
NativeMemory
.Alloc((nuint)(size + sizeof(void*)));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (2)
112
NativeMemory
.Free(curr);
159
var newBlock = (void**)
NativeMemory
.Alloc((nuint)(size + sizeof(void*)));
Microsoft.Diagnostics.DataContractReader.Legacy (21)
Dbi\DacDbiImpl.cs (2)
1833
byte* pLocal = (byte*)
NativeMemory
.AlignedAlloc(contextSize, 16);
1858
NativeMemory
.AlignedFree(pLocal);
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ICLRDataTarget2.cs (1)
39
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ICLRDataTarget3.cs (1)
42
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ICorDebugMutableDataTarget.cs (1)
32
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.IMetaDataImport2.cs (1)
96
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSHandleEnum.cs (1)
30
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSMemoryEnum.cs (1)
30
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSMethodEnum.cs (1)
30
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum.cs (1)
31
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefErrorEnum.cs (1)
30
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStressLogMsgEnum.cs (1)
31
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStressLogThreadEnum.cs (1)
30
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.IXCLRDataExceptionNotification2.cs (1)
37
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.IXCLRDataExceptionNotification3.cs (1)
38
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.IXCLRDataExceptionNotification4.cs (1)
39
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.IXCLRDataExceptionNotification5.cs (1)
40
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.IXCLRDataProcess2.cs (1)
74
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.IXCLRDataProcess3.cs (1)
75
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.IXCLRDataTarget3.cs (1)
40
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
SOSDacImpl.cs (1)
2370
NativeMemory
.Clear(rgRevertedRejitData, (nuint)(sizeof(DacpReJitData) * cRevertedRejitVersions));
Microsoft.DiaSymReader (10)
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedBinder2.cs (1)
29
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedBinder3.cs (1)
30
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedBinder4.cs (1)
32
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedMethod2.cs (1)
37
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedReader2.cs (1)
46
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedReader3.cs (1)
48
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedReader4.cs (1)
51
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedReader5.cs (1)
52
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedScope2.cs (1)
36
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
Generated\361d1da7f942c932\Microsoft.DiaSymReader.ISymUnmanagedWriter8.cs (1)
64
global::System.Runtime.InteropServices.
NativeMemory
.Copy(
System.Diagnostics.Process (8)
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (2)
350
NativeMemory
.Free(envpPtr);
351
NativeMemory
.Free(argvPtr);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (4)
87
NativeMemory
.Free(envpPtr);
88
NativeMemory
.Free(argvPtr);
129
byte* block = (byte*)
NativeMemory
.Alloc(checked(pointersByteLength + (nuint)dataByteLength));
172
byte* block = (byte*)
NativeMemory
.Alloc(checked(pointersByteLength + (nuint)dataByteLength));
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (2)
47
buffer = new Span<byte>((byte*)
NativeMemory
.Alloc((nuint)exactByteCount), exactByteCount);
71
NativeMemory
.Free(_unmanagedValue);
System.Net.Http.WinHttpHandler (2)
src\runtime\src\libraries\Common\src\Interop\Windows\WinHttp\Interop.winhttp.cs (2)
70
void* value =
NativeMemory
.Alloc(sizeof(char) * (nuint)length);
77
public static void Free(void* value) =>
NativeMemory
.Free(value);
System.Net.Ping (2)
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (2)
47
buffer = new Span<byte>((byte*)
NativeMemory
.Alloc((nuint)exactByteCount), exactByteCount);
71
NativeMemory
.Free(_unmanagedValue);
System.Net.Quic (7)
System\Net\Quic\Internal\MsQuicBuffers.cs (4)
37
NativeMemory
.Free(buffers);
45
_buffers = (QUIC_BUFFER*)
NativeMemory
.AllocZeroed((nuint)count, (nuint)sizeof(QUIC_BUFFER));
56
_buffers[index].Buffer = (byte*)
NativeMemory
.Alloc((nuint)buffer.Length, (nuint)sizeof(byte));
102
NativeMemory
.Free(buffer);
System\Net\Quic\Internal\MsQuicTlsSecret.cs (3)
27
tlsSecrets = (QUIC_TLS_SECRETS*)
NativeMemory
.AllocZeroed((nuint)sizeof(QUIC_TLS_SECRETS));
41
NativeMemory
.Free(tlsSecrets);
134
NativeMemory
.Free(tlsSecrets);
System.Private.CoreLib (47)
Internal\Runtime\CompilerHelpers\InteropHelpers.cs (1)
441
NativeMemory
.Clear(ptr, (uint)size);
Internal\Runtime\CompilerServices\FunctionPointerOps.cs (1)
71
descriptor = (IntPtr)
NativeMemory
.Alloc((uint)sizeof(GenericMethodDescriptor));
Internal\Runtime\CompilerServices\OpenMethodResolver.cs (1)
231
returnValue = (IntPtr)
NativeMemory
.Alloc((nuint)sizeof(OpenMethodResolver));
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (2)
47
buffer = new Span<byte>((byte*)
NativeMemory
.Alloc((nuint)exactByteCount), exactByteCount);
71
NativeMemory
.Free(_unmanagedValue);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (1)
268
NativeMemory
.Clear(memory.Pointer, sharedDataTotalByteCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (3)
587
NativeMemory
.Clear(_mem + len, (nuint)(value - len));
651
NativeMemory
.Clear(_mem + len, (nuint)(pos - len));
780
NativeMemory
.Clear(_mem + len, (nuint)(pos - len));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (2)
533
NativeMemory
.AlignedFree(_wrapper);
920
IntPtr wrapperMem = (IntPtr)
NativeMemory
.AlignedAlloc(
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (5)
1273
NativeMemory
.Clear((void*)s, SysStringByteLen(s));
1288
NativeMemory
.Clear((void*)s, (nuint)string.wcslen((char*)s) * sizeof(char));
1298
NativeMemory
.Clear((void*)s, (nuint)string.strlen((byte*)s));
1308
NativeMemory
.Clear((void*)s, (nuint)string.strlen((byte*)s));
1318
NativeMemory
.Clear((void*)s, (nuint)string.wcslen((char*)s) * sizeof(char));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (4)
62
return (nint)
NativeMemory
.Alloc((nuint)cb);
67
NativeMemory
.Free((void*)(nint)hglobal);
72
return (nint)
NativeMemory
.Realloc((void*)(nint)pv, (nuint)cb);
90
return (nint)
NativeMemory
.Realloc((void*)(nint)pv, cbNative);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (2)
86
buffer = new Span<byte>((byte*)
NativeMemory
.Alloc((nuint)exactByteCount), exactByteCount);
109
NativeMemory
.Free(_unmanagedValue);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (2)
160
_allocatedMemory = (TUnmanagedElement*)
NativeMemory
.Alloc((nuint)spaceToAllocate);
198
NativeMemory
.Free(_allocatedMemory);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (2)
161
_allocatedMemory = (TUnmanagedElement*)
NativeMemory
.Alloc((nuint)spaceToAllocate);
199
NativeMemory
.Free(_allocatedMemory);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (2)
127
_allocatedMemory = (TUnmanagedElement*)
NativeMemory
.Alloc((nuint)bufferSize);
163
NativeMemory
.Free(_allocatedMemory);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (2)
159
_allocatedMemory = (TUnmanagedElement*)
NativeMemory
.Alloc((nuint)bufferSize);
195
NativeMemory
.Free(_allocatedMemory);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
90
buffer = new Span<byte>((byte*)
NativeMemory
.Alloc((nuint)exactByteCount), exactByteCount);
114
NativeMemory
.Free(_unmanagedValue);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelThreadBlocker.cs (2)
40
_pState = (int*)
NativeMemory
.AlignedAlloc(Internal.PaddingHelpers.CACHE_LINE_SIZE, Internal.PaddingHelpers.CACHE_LINE_SIZE);
64
NativeMemory
.AlignedFree(_pState);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (2)
150
pNativeOverlapped = (NativeOverlapped*)
NativeMemory
.Alloc(
213
NativeMemory
.Free(pNativeOverlapped);
System\GC.NativeAot.cs (2)
325
pWorkItem = (NoGCRegionCallbackFinalizerWorkItem*)
NativeMemory
.AllocZeroed((nuint)sizeof(NoGCRegionCallbackFinalizerWorkItem));
363
NativeMemory
.Free(pWorkItem);
System\Reflection\DynamicInvokeInfo.cs (2)
407
NativeMemory
.Clear(pStorage, (nuint)(2 * argCount) * (nuint)sizeof(IntPtr));
456
NativeMemory
.Clear(pStorage, (nuint)(2 * argCount) * (nuint)sizeof(IntPtr));
System\Runtime\CompilerServices\RuntimeHelpers.NativeAot.cs (3)
251
return (IntPtr)
NativeMemory
.AllocZeroed((uint)size);
278
void* result =
NativeMemory
.AlignedAlloc((uint)size, (uint)alignment);
279
NativeMemory
.Clear(result, (uint)size);
System\Runtime\InteropServices\Marshal.NativeAot.cs (2)
266
NativeMemory
.Clear((void*)nativeBytes, (nuint)size);
344
NativeMemory
.Clear((void*)nativeBytes, (nuint)size);
System\Runtime\InteropServices\PInvokeMarshal.cs (2)
131
ContextData = (IntPtr)
NativeMemory
.AllocZeroed((nuint)(2 * IntPtr.Size));
165
NativeMemory
.Free((void*)ContextData);
System.Private.TypeLoader (4)
Internal\Runtime\TypeLoader\EETypeCreator.cs (4)
114
return
NativeMemory
.Alloc((nuint)cbBytes);
119
NativeMemory
.Free(memoryPtrToFree);
296
NativeMemory
.Clear(writableData, (nuint)WritableData.GetSize(IntPtr.Size));
323
NativeMemory
.Clear(nonGcStaticData, (nuint)allocatedNonGCDataSize);
System.Runtime.InteropServices (1)
src\runtime\artifacts\obj\System.Runtime.InteropServices\Release\net11.0\System.Runtime.InteropServices.Forwards.cs (1)
122
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.
NativeMemory
))]
System.Runtime.InteropServices.JavaScript (18)
System\Runtime\InteropServices\JavaScript\JSFunctionBinding.cs (1)
443
NativeMemory
.Free((void*)exceptionPtr);
System\Runtime\InteropServices\JavaScript\JSHostImplementation.cs (2)
132
IntPtr buffer = (IntPtr)
NativeMemory
.Alloc((nuint)size);
186
NativeMemory
.Free(signature.Header);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Byte.cs (2)
95
NativeMemory
.Free((void*)slot.IntPtrValue);
112
slot.IntPtrValue = (IntPtr)
NativeMemory
.Alloc((nuint)(value.Length * sizeof(byte)));
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Double.cs (2)
98
NativeMemory
.Free((void*)slot.IntPtrValue);
117
slot.IntPtrValue = (IntPtr)
NativeMemory
.Alloc((nuint)(value.Length * sizeof(double)));
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Int32.cs (2)
95
NativeMemory
.Free((void*)slot.IntPtrValue);
111
slot.IntPtrValue = (IntPtr)
NativeMemory
.Alloc((nuint)(value.Length * sizeof(int)));
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.JSObject.cs (2)
91
NativeMemory
.Free((void*)slot.IntPtrValue);
113
JSMarshalerArgument* payload = (JSMarshalerArgument*)
NativeMemory
.Alloc((nuint)bytes);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Object.cs (2)
372
NativeMemory
.Free((void*)slot.IntPtrValue);
393
JSMarshalerArgument* payload = (JSMarshalerArgument*)
NativeMemory
.Alloc((nuint)bytes);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Single.cs (2)
98
NativeMemory
.Free((void*)slot.IntPtrValue);
117
slot.IntPtrValue = (IntPtr)
NativeMemory
.Alloc((nuint)(value.Length * sizeof(float)));
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.String.cs (3)
27
NativeMemory
.Free((void*)slot.IntPtrValue);
99
NativeMemory
.Free((void*)slot.IntPtrValue);
120
JSMarshalerArgument* payload = (JSMarshalerArgument*)
NativeMemory
.Alloc((nuint)bytes);
System.Security.Cryptography (2)
System\Security\Cryptography\FixedMemoryKeyBox.cs (2)
14
void* memory =
NativeMemory
.Alloc((nuint)key.Length);
25
NativeMemory
.Free((void*)handle);