UniTaskLoopRunnerYieldInitialization
UniTaskLoopRunnerInitialization
PlayerUpdateTime
DirectorSampleTime
AsyncUploadTimeSlicedUpdate
SynchronizeInputs
SynchronizeState
XREarlyUpdate
This file contains 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 FileComparer | |
{ | |
public static bool CompareEquals(string filePath1, string filePath2, int bufferSize = 65536) | |
{ | |
if (filePath1 == filePath2) return true; | |
var buffer1 = ArrayPool<byte>.Shared.Rent(bufferSize); | |
var buffer2 = ArrayPool<byte>.Shared.Rent(bufferSize); | |
try | |
{ |
This file contains 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.Net; | |
using System.Net.Http; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using UnityEngine; | |
using UnityEngine.Networking; |
This file contains 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
[StructLayout(LayoutKind.Auto)] | |
internal struct CompactListCore<T> | |
where T : class | |
{ | |
const double ShrinkRate = 0.8; | |
const int InitialArraySize = 4; | |
const int MinShrinkStartSize = 16; | |
readonly object gate; | |
T?[]? values = null; |
This file contains 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.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Text.Json; | |
namespace ZLogger.Internal; | |
internal sealed class EnumDictionary | |
{ | |
readonly Entry[][] buckets; // immutable array. |
This file contains 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 async Task SendAsync(CancellationToken cancellationToken = default) | |
{ | |
var timeoutTokenSource = timeoutTokenSourcePool.Get(); | |
CancellationTokenRegistration externalCancellation = default; | |
if (cancellationToken.CanBeCanceled) | |
{ | |
externalCancellation = cancellationToken.UnsafeRegister(static state => | |
{ | |
((CancellationTokenSource)state!).Cancel(); |
This file contains 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
//<Project Sdk="Microsoft.NET.Sdk"> | |
// <PropertyGroup> | |
// <OutputType>Exe</OutputType> | |
// <TargetFramework>net6.0</TargetFramework> | |
// <ImplicitUsings>enable</ImplicitUsings> | |
// <Nullable>enable</Nullable> | |
// </PropertyGroup> | |
// <ItemGroup> | |
// <PackageReference Include="BenchmarkDotNet" Version="0.13.2" /> | |
// <PackageReference Include="MessagePack" Version="2.4.35" /> |
This file contains 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
class Client : IDisposable | |
{ | |
// called from IDisposable.Dispose | |
readonly CancellationTokenSource clientLifetimeTokenSource; | |
public TimeSpan Timeout { get; } | |
public Client(TimeSpan timeout) | |
{ | |
this.Timeout = timeout; |
This file contains 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
class Client : IDisposable | |
{ | |
readonly TimeSpan timeout; | |
readonly ObjectPool<CancellationTokenSource> timeoutTokenSourcePool; | |
readonly CancellationTokenSource clientLifetimeTokenSource; | |
public TimeSpan Timeout { get; } | |
public Client(TimeSpan timeout) | |
{ |
This file contains 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 async Task SendAsync(CancellationToken cancellationToken = default) | |
{ | |
var timeoutTokenSource = timeoutTokenSourcePool.Get(); | |
CancellationTokenRegistration externalCancellation = default; | |
if (cancellationToken.CanBeCanceled) | |
{ | |
// When raised argument CancellationToken, raise Timeout's CancellationToken | |
externalCancellation = cancellationToken.UnsafeRegister(static state => | |
{ |
NewerOlder