73 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 (6)
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);
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.Ping (2)
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 (41)
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\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (1)
267
NativeMemory
.Clear(memory.Pointer, sharedDataTotalByteCount);
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\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)
532
NativeMemory
.AlignedFree(_wrapper);
873
IntPtr wrapperMem = (IntPtr)
NativeMemory
.AlignedAlloc(
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (5)
1271
NativeMemory
.Clear((void*)s, SysStringByteLen(s));
1286
NativeMemory
.Clear((void*)s, (nuint)string.wcslen((char*)s) * sizeof(char));
1296
NativeMemory
.Clear((void*)s, (nuint)string.strlen((byte*)s));
1306
NativeMemory
.Clear((void*)s, (nuint)string.strlen((byte*)s));
1316
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)cb);
66
NativeMemory
.Free((void*)(nint)hglobal);
71
return (nint)
NativeMemory
.Realloc((void*)(nint)pv, (nuint)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)
159
_allocatedMemory = (TUnmanagedElement*)
NativeMemory
.Alloc((nuint)spaceToAllocate);
197
NativeMemory
.Free(_allocatedMemory);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (2)
160
_allocatedMemory = (TUnmanagedElement*)
NativeMemory
.Alloc((nuint)spaceToAllocate);
198
NativeMemory
.Free(_allocatedMemory);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (2)
126
_allocatedMemory = (TUnmanagedElement*)
NativeMemory
.Alloc((nuint)bufferSize);
162
NativeMemory
.Free(_allocatedMemory);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (2)
158
_allocatedMemory = (TUnmanagedElement*)
NativeMemory
.Alloc((nuint)bufferSize);
194
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)
719
pWorkItem = (NoGCRegionCallbackFinalizerWorkItem*)
NativeMemory
.AllocZeroed((nuint)sizeof(NoGCRegionCallbackFinalizerWorkItem));
757
NativeMemory
.Free(pWorkItem);
System.Runtime.InteropServices (1)
artifacts\obj\System.Runtime.InteropServices\Debug\net11.0\System.Runtime.InteropServices.Forwards.cs (1)
122
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.
NativeMemory
))]
System.Security.Cryptography (4)
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\Security\Cryptography\FixedMemoryKeyBox.cs (2)
14
void* memory =
NativeMemory
.Alloc((nuint)key.Length);
25
NativeMemory
.Free((void*)handle);