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