Skip to content

Commit

Permalink
Update MemoryPoolExtension.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightczx committed Feb 1, 2025
1 parent 25b9194 commit 0dc00ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Snap.Hutao/Snap.Hutao/Extension/MemoryPoolExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

namespace Snap.Hutao.Extension;

internal static class MemoryPoolExtension
internal static partial class MemoryPoolExtension
{
public static IMemoryOwner<T> RentExactly<T>(this MemoryPool<T> memoryPool, int bufferSize)
{
IMemoryOwner<T> memoryOwner = memoryPool.Rent(bufferSize);
return new ExactSizedMemoryOwner<T>(memoryOwner, bufferSize);
}

private sealed class ExactSizedMemoryOwner<T> : IMemoryOwner<T>
private sealed partial class ExactSizedMemoryOwner<T> : IMemoryOwner<T>
{
private readonly IMemoryOwner<T> owner;
private readonly int bufferSize;
Expand Down

0 comments on commit 0dc00ce

Please sign in to comment.