This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class AlignedSizedMemoryPool<T> where T:unmanaged | |
| { | |
| private const int ByteAlignment = 32; | |
| private static readonly int SizeOf = StructSize.GetSize<T>(default); | |
| private static readonly int Alignment = ByteAlignment / SizeOf; | |
| public static IMemoryOwner<T> Rent(int bufferSize) | |
| { | |
| if (SizeOf == -1) throw new InvalidOperationException(String.Format("Type {0} cannot be aligned", typeof(T))); | |
| return new SizedMemoryOwner(ArrayPool<T>.Shared.Rent(bufferSize + Alignment), bufferSize); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using Simple.OData.Client; | |
| public class ODataDerivedTypeCustomConverter | |
| { | |
| private static readonly string AnnotationKey = "__annotations"; | |
| private readonly Type _baseType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Simple.OData.Client.Core/ODataClient.Internals.cs | 15 +++++++++------ | |
| 1 file changed, 9 insertions(+), 6 deletions(-) | |
| diff --git a/Simple.OData.Client.Core/ODataClient.Internals.cs b/Simple.OData.Client.Core/ODataClient.Internals.cs | |
| index c79e0ac..53431d4 100644 | |
| --- a/Simple.OData.Client.Core/ODataClient.Internals.cs | |
| +++ b/Simple.OData.Client.Core/ODataClient.Internals.cs | |
| @@ -23,13 +23,16 @@ namespace Simple.OData.Client | |
| var result = await ExecuteRequestWithResultAsync(request, cancellationToken, |