65 references to NativeMemory
Interop.FunctionalTests (2)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (2)
112NativeMemory.Free(curr); 159var newBlock = (void**)NativeMemory.Alloc((nuint)(size + sizeof(void*)));
Microsoft.AspNetCore.Server.HttpSys (2)
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\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\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\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\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (2)
112NativeMemory.Free(curr); 159var newBlock = (void**)NativeMemory.Alloc((nuint)(size + sizeof(void*)));
System.Diagnostics.Process (4)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (4)
59arrPtr = (byte**)NativeMemory.AllocZeroed(arrLength, (nuint)sizeof(byte*)); 68arrPtr[i] = (byte*)NativeMemory.Alloc((nuint)byteLength + 1); //+1 for null termination 84NativeMemory.Free(arr[i]); 88NativeMemory.Free(arr);
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 (39)
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (3)
586NativeMemory.Clear(_mem + len, (nuint)(value - len)); 650NativeMemory.Clear(_mem + len, (nuint)(pos - len)); 779NativeMemory.Clear(_mem + len, (nuint)(pos - len));
src\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (1)
1328NativeMemory.Clear(
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (2)
319NativeMemory.Clear(pArgStorage, (nuint)_argCount * (nuint)sizeof(IntPtr)); 350NativeMemory.Clear(pStorage, (nuint)(2 * _argCount) * (nuint)sizeof(IntPtr));
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Constructor.cs (1)
28NativeMemory.Clear(pStorage, (nuint)(2 * argCount) * (nuint)sizeof(IntPtr));
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (2)
204NativeMemory.Clear(pArgStorage, (nuint)_argCount * (nuint)sizeof(IntPtr) * 2); 239NativeMemory.Clear(pStorage, (nuint)(3 * _argCount) * (nuint)sizeof(IntPtr));
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (2)
372NativeMemory.Clear(pArgStorage, (nuint)_argCount * (nuint)sizeof(IntPtr)); 403NativeMemory.Clear(pStorage, (nuint)(2 * _argCount) * (nuint)sizeof(IntPtr));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (2)
521NativeMemory.AlignedFree(_wrapper); 862IntPtr wrapperMem = (IntPtr)NativeMemory.AlignedAlloc(
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (5)
1171NativeMemory.Clear((void*)s, SysStringByteLen(s)); 1186NativeMemory.Clear((void*)s, (nuint)string.wcslen((char*)s) * sizeof(char)); 1196NativeMemory.Clear((void*)s, (nuint)string.strlen((byte*)s)); 1206NativeMemory.Clear((void*)s, (nuint)string.strlen((byte*)s)); 1216NativeMemory.Clear((void*)s, (nuint)string.wcslen((char*)s) * sizeof(char));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (4)
61return (nint)NativeMemory.Alloc((nuint)(nint)cb); 66NativeMemory.Free((void*)(nint)hglobal); 71return (nint)NativeMemory.Realloc((void*)(nint)pv, (nuint)(nint)cb); 89return (nint)NativeMemory.Realloc((void*)(nint)pv, cbNative);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (2)
85buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount); 108NativeMemory.Free(_unmanagedValue);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (2)
149_allocatedMemory = (TUnmanagedElement*)NativeMemory.Alloc((nuint)spaceToAllocate); 187NativeMemory.Free(_allocatedMemory);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (2)
150_allocatedMemory = (TUnmanagedElement*)NativeMemory.Alloc((nuint)spaceToAllocate); 188NativeMemory.Free(_allocatedMemory);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (2)
121_allocatedMemory = (TUnmanagedElement*)NativeMemory.Alloc((nuint)bufferSize); 157NativeMemory.Free(_allocatedMemory);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (2)
148_allocatedMemory = (TUnmanagedElement*)NativeMemory.Alloc((nuint)bufferSize); 184NativeMemory.Free(_allocatedMemory);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
89buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount); 113NativeMemory.Free(_unmanagedValue);
src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (2)
149pNativeOverlapped = (NativeOverlapped*)NativeMemory.Alloc( 212NativeMemory.Free(pNativeOverlapped);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (1)
65overlapped = (Win32ThreadPoolNativeOverlapped*)NativeMemory.Alloc((nuint)sizeof(Win32ThreadPoolNativeOverlapped));
src\System\GC.CoreCLR.cs (2)
718pWorkItem = (NoGCRegionCallbackFinalizerWorkItem*)NativeMemory.AllocZeroed((nuint)sizeof(NoGCRegionCallbackFinalizerWorkItem)); 756NativeMemory.Free(pWorkItem);
System.Runtime.InteropServices (1)
artifacts\obj\System.Runtime.InteropServices\Debug\net10.0\System.Runtime.InteropServices.Forwards.cs (1)
122[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.NativeMemory))]
System.Security.Cryptography (2)
System\Security\Cryptography\FixedMemoryKeyBox.cs (2)
14void* memory = NativeMemory.Alloc((nuint)key.Length); 25NativeMemory.Free((void*)handle);