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