Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/aspnet/MessagePack-CSharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/MessagePack/Internal/UnsafeMemory.tt')
-rw-r--r--src/MessagePack/Internal/UnsafeMemory.tt67
1 files changed, 0 insertions, 67 deletions
diff --git a/src/MessagePack/Internal/UnsafeMemory.tt b/src/MessagePack/Internal/UnsafeMemory.tt
deleted file mode 100644
index dbf7797f..00000000
--- a/src/MessagePack/Internal/UnsafeMemory.tt
+++ /dev/null
@@ -1,67 +0,0 @@
-<#@ template debug="false" hostspecific="false" language="C#" #>
-<#@ assembly name="System.Core" #>
-<#@ import namespace="System.Linq" #>
-<#@ import namespace="System.Text" #>
-<#@ import namespace="System.Collections.Generic" #>
-<#@ output extension=".cs" #>
-<#
- var Max = 31;
-#>
-#if NETSTANDARD
-
-using System.Runtime.CompilerServices;
-
-namespace MessagePack.Internal
-{
- public static partial class UnsafeMemory32
- {
-<# for(var i = 4; i <= Max; i++) { #>
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static unsafe int WriteRaw<#= i #>(ref byte[] dst, int dstOffset, byte[] src)
- {
- MessagePackBinary.EnsureCapacity(ref dst, dstOffset, src.Length);
-
- fixed (byte* pSrc = &src[0])
- fixed (byte* pDst = &dst[dstOffset])
- {
-<# for(var j = 0; j < (i / 4); j++) { #>
- *(int*)(pDst + <#= (4 * j) #>) = *(int*)(pSrc + <#= (4 * j) #>);
-<# } #>
-<# if(i % 4 != 0) { #>
- *(int*)(pDst + <#= i - 4 #>) = *(int*)(pSrc + <#= (i - 4) #>);
-<# } #>
- }
-
- return src.Length;
- }
-
-<# } #>
- }
-
- public static partial class UnsafeMemory64
- {
-<# for(var i = 8; i <= Max; i++) { #>
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static unsafe int WriteRaw<#= i #>(ref byte[] dst, int dstOffset, byte[] src)
- {
- MessagePackBinary.EnsureCapacity(ref dst, dstOffset, src.Length);
-
- fixed (byte* pSrc = &src[0])
- fixed (byte* pDst = &dst[dstOffset])
- {
-<# for(var j = 0; j < (i / 8); j++) { #>
- *(long*)(pDst + <#= (8 * j) #>) = *(long*)(pSrc + <#= (8 * j) #>);
-<# } #>
-<# if(i % 8 != 0) { #>
- *(long*)(pDst + <#= i - 8 #>) = *(long*)(pSrc + <#= (i - 8) #>);
-<# } #>
- }
-
- return src.Length;
- }
-
-<# } #>
- }
-}
-
-#endif \ No newline at end of file