Skip to content

Commit 5ad073f

Browse files
Update helper names across runtimes.
1 parent e45742c commit 5ad073f

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ namespace System
1010
public partial class Buffer
1111
{
1212
[LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_Clear")]
13-
private static unsafe partial void __ZeroMemory(void* b, nuint byteLength);
13+
private static unsafe partial void ZeroMemoryInternal(void* b, nuint byteLength);
1414

1515
[LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_MemMove")]
16-
private static unsafe partial void __Memmove(byte* dest, byte* src, nuint len);
16+
private static unsafe partial void MemmoveInternal(byte* dest, byte* src, nuint len);
1717

1818
[MethodImpl(MethodImplOptions.InternalCall)]
19-
private static extern void __BulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount);
19+
private static extern void BulkMoveWithWriteBarrierInternal(ref byte destination, ref byte source, nuint byteCount);
2020

2121
// Used by ilmarshalers.cpp
2222
internal static unsafe void Memcpy(byte* dest, byte* src, int len)

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Buffer.NativeAot.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ namespace System
1212
public static partial class Buffer
1313
{
1414
[MethodImpl(MethodImplOptions.AggressiveInlining)]
15-
private static unsafe void __ZeroMemory(void* b, nuint byteLength) =>
15+
private static unsafe void ZeroMemoryInternal(void* b, nuint byteLength) =>
1616
RuntimeImports.memset((byte*)b, 0, byteLength);
1717

1818
[MethodImpl(MethodImplOptions.AggressiveInlining)]
19-
private static unsafe void __Memmove(byte* dest, byte* src, nuint len) =>
19+
private static unsafe void MemmoveInternal(byte* dest, byte* src, nuint len) =>
2020
RuntimeImports.memmove(dest, src, len);
2121

2222
[MethodImpl(MethodImplOptions.AggressiveInlining)]
23-
private static void __BulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount) =>
23+
private static void BulkMoveWithWriteBarrierInternal(ref byte destination, ref byte source, nuint byteCount) =>
2424
RuntimeImports.RhBulkMoveWithWriteBarrier(ref destination, ref source, byteCount);
2525
}
2626
}

src/coreclr/vm/ecalllist.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ FCFuncStart(gArrayFuncs)
250250
FCFuncEnd()
251251

252252
FCFuncStart(gBufferFuncs)
253-
FCFuncElement("__BulkMoveWithWriteBarrier", Buffer::BulkMoveWithWriteBarrier)
253+
FCFuncElement("BulkMoveWithWriteBarrierInternal", Buffer::BulkMoveWithWriteBarrier)
254254
FCFuncEnd()
255255

256256
FCFuncStart(gGCFrameRegistration)

src/libraries/System.Private.CoreLib/src/System/Buffer.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,21 @@ public static unsafe void MemoryCopy(void* source, void* destination, ulong dest
127127
// Non-inlinable wrapper around the QCall that avoids polluting the fast path
128128
// with P/Invoke prolog/epilog.
129129
[MethodImpl(MethodImplOptions.NoInlining)]
130-
internal static unsafe void _Memmove(ref byte dest, ref byte src, nuint len)
130+
internal static unsafe void Memmove(ref byte dest, ref byte src, nuint len)
131131
{
132132
fixed (byte* pDest = &dest)
133133
fixed (byte* pSrc = &src)
134-
__Memmove(pDest, pSrc, len);
134+
MemmoveInternal(pDest, pSrc, len);
135135
}
136136

137137
// Non-inlinable wrapper around the QCall that avoids polluting the fast path
138138
// with P/Invoke prolog/epilog.
139139
[MethodImpl(MethodImplOptions.NoInlining)]
140-
internal static unsafe void _ZeroMemory(ref byte b, nuint byteLength)
140+
internal static unsafe void ZeroMemory(ref byte b, nuint byteLength)
141141
{
142142
fixed (byte* bytePointer = &b)
143143
{
144-
__ZeroMemory(bytePointer, byteLength);
144+
ZeroMemoryInternal(bytePointer, byteLength);
145145
}
146146
}
147147

@@ -169,7 +169,7 @@ ref Unsafe.As<T, byte>(ref source),
169169
}
170170
}
171171

172-
// The maximum block size to for __BulkMoveWithWriteBarrier FCall. This is required to avoid GC starvation.
172+
// The maximum block size to for BulkMoveWithWriteBarrierInternal FCall. This is required to avoid GC starvation.
173173
#if DEBUG // Stress the mechanism in debug builds
174174
private const uint BulkMoveWithWriteBarrierChunk = 0x400;
175175
#else
@@ -180,18 +180,18 @@ internal static void BulkMoveWithWriteBarrier(ref byte destination, ref byte sou
180180
{
181181
if (byteCount <= BulkMoveWithWriteBarrierChunk)
182182
{
183-
__BulkMoveWithWriteBarrier(ref destination, ref source, byteCount);
183+
BulkMoveWithWriteBarrierInternal(ref destination, ref source, byteCount);
184184
Thread.FastPollGC();
185185
}
186186
else
187187
{
188-
_BulkMoveWithWriteBarrier(ref destination, ref source, byteCount);
188+
BulkMoveWithWriteBarrierBatch(ref destination, ref source, byteCount);
189189
}
190190
}
191191

192192
// Non-inlinable wrapper around the loop for copying large blocks in chunks
193193
[MethodImpl(MethodImplOptions.NoInlining)]
194-
private static void _BulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount)
194+
private static void BulkMoveWithWriteBarrierBatch(ref byte destination, ref byte source, nuint byteCount)
195195
{
196196
Debug.Assert(byteCount > BulkMoveWithWriteBarrierChunk);
197197

@@ -205,7 +205,7 @@ private static void _BulkMoveWithWriteBarrier(ref byte destination, ref byte sou
205205
do
206206
{
207207
byteCount -= BulkMoveWithWriteBarrierChunk;
208-
__BulkMoveWithWriteBarrier(ref destination, ref source, BulkMoveWithWriteBarrierChunk);
208+
BulkMoveWithWriteBarrierInternal(ref destination, ref source, BulkMoveWithWriteBarrierChunk);
209209
Thread.FastPollGC();
210210
destination = ref Unsafe.AddByteOffset(ref destination, BulkMoveWithWriteBarrierChunk);
211211
source = ref Unsafe.AddByteOffset(ref source, BulkMoveWithWriteBarrierChunk);
@@ -218,12 +218,12 @@ private static void _BulkMoveWithWriteBarrier(ref byte destination, ref byte sou
218218
do
219219
{
220220
byteCount -= BulkMoveWithWriteBarrierChunk;
221-
__BulkMoveWithWriteBarrier(ref Unsafe.AddByteOffset(ref destination, byteCount), ref Unsafe.AddByteOffset(ref source, byteCount), BulkMoveWithWriteBarrierChunk);
221+
BulkMoveWithWriteBarrierInternal(ref Unsafe.AddByteOffset(ref destination, byteCount), ref Unsafe.AddByteOffset(ref source, byteCount), BulkMoveWithWriteBarrierChunk);
222222
Thread.FastPollGC();
223223
}
224224
while (byteCount > BulkMoveWithWriteBarrierChunk);
225225
}
226-
__BulkMoveWithWriteBarrier(ref destination, ref source, byteCount);
226+
BulkMoveWithWriteBarrierInternal(ref destination, ref source, byteCount);
227227
Thread.FastPollGC();
228228
}
229229

src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ internal static void Memmove(ref byte dest, ref byte src, nuint len)
239239
Debug.Assert(len > 0);
240240
_ = Unsafe.ReadUnaligned<byte>(ref dest);
241241
_ = Unsafe.ReadUnaligned<byte>(ref src);
242-
Buffer._Memmove(ref dest, ref src, len);
242+
Buffer.Memmove(ref dest, ref src, len);
243243
}
244244

245245
[Intrinsic] // Unrolled for small sizes
@@ -425,7 +425,7 @@ public static void ClearWithoutReferences(ref byte dest, nuint len)
425425
PInvoke:
426426
// Implicit nullchecks
427427
_ = Unsafe.ReadUnaligned<byte>(ref dest);
428-
Buffer._ZeroMemory(ref dest, len);
428+
Buffer.ZeroMemory(ref dest, len);
429429
}
430430

431431
internal static void Fill(ref byte dest, byte value, nuint len)

src/mono/System.Private.CoreLib/src/System/Buffer.Mono.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ namespace System
88
public partial class Buffer
99
{
1010
[MethodImpl(MethodImplOptions.InternalCall)]
11-
private static extern unsafe void __ZeroMemory(void* b, nuint byteLength);
11+
private static extern unsafe void ZeroMemoryInternal(void* b, nuint byteLength);
1212

1313
[MethodImpl(MethodImplOptions.InternalCall)]
14-
private static extern unsafe void __Memmove(byte* dest, byte* src, nuint len);
14+
private static extern unsafe void MemmoveInternal(byte* dest, byte* src, nuint len);
1515

1616
[MethodImpl(MethodImplOptions.InternalCall)]
1717
private static extern void BulkMoveWithWriteBarrier(ref byte dmem, ref byte smem, nuint len, IntPtr type_handle);

src/mono/mono/metadata/icall-def.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ HANDLES(ARRAY_14, "SetValueRelaxedImpl", ves_icall_System_Array_SetValueRelaxed
140140

141141
ICALL_TYPE(BUFFER, "System.Buffer", BUFFER_0)
142142
NOHANDLES(ICALL(BUFFER_0, "BulkMoveWithWriteBarrier", ves_icall_System_Buffer_BulkMoveWithWriteBarrier))
143-
NOHANDLES(ICALL(BUFFER_2, "__Memmove", ves_icall_System_Runtime_RuntimeImports_Memmove))
144-
NOHANDLES(ICALL(BUFFER_3, "__ZeroMemory", ves_icall_System_Runtime_RuntimeImports_ZeroMemory))
143+
NOHANDLES(ICALL(BUFFER_2, "MemmoveInternal", ves_icall_System_Runtime_RuntimeImports_Memmove))
144+
NOHANDLES(ICALL(BUFFER_3, "ZeroMemoryInternal", ves_icall_System_Runtime_RuntimeImports_ZeroMemory))
145145

146146
ICALL_TYPE(DELEGATE, "System.Delegate", DELEGATE_1)
147147
HANDLES(DELEGATE_1, "AllocDelegateLike_internal", ves_icall_System_Delegate_AllocDelegateLike_internal, MonoMulticastDelegate, 1, (MonoDelegate))

0 commit comments

Comments
 (0)