Conversation
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/bac002a1-5e0d-46d6-9ca1-581d04ae31d3 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/fcf762b3-7df5-41c7-b1d4-df5e161e47ef Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors the temporary-span renting API by replacing the ArrayPool<T>.RentOwner() extension with a dedicated SpanPool<T> type, making the pooling abstraction a first-class concept in PowerKit.
Changes:
- Added
SpanPool<T>(backed byArrayPool<T>) and movedISpanOwner<T>+ implementation into the new file. - Removed the
ArrayPool<T>.RentOwner()extension and updated the only in-repo call site. - Replaced the old extension-focused tests with
SpanPool-focused tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| PowerKit/SpanPool.cs | Introduces SpanPool<T> + ISpanOwner<T> and the pooled-span owner implementation. |
| PowerKit/Extensions/FileExtensions.cs | Updates buffer renting in File.Contains() to use SpanPool<T>.Shared.Rent(...). |
| PowerKit/Extensions/ArrayPoolExtensions.cs | Removes the old RentOwner extension implementation. |
| PowerKit.Tests/SpanPoolTests.cs | Adds tests for renting and disposal behavior via SpanPool<T>. |
| PowerKit.Tests/Extensions/ArrayPoolExtensionsTests.cs | Removes tests for the deleted RentOwner extension. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/9d24af42-de61-4b6f-a7a3-05bfba42536f Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## prime #74 +/- ##
=======================================
Coverage 93.88% 93.88%
=======================================
Files 128 128
Lines 2534 2536 +2
Branches 201 201
=======================================
+ Hits 2379 2381 +2
Misses 112 112
Partials 43 43 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ISpanOwner<T>and its renting logic were awkwardly bolted ontoArrayPool<T>via an extension method. This promotes them to a first-classSpanPool<T>type with a cleaner, purpose-built API.Changes
PowerKit/SpanPool.cs— introducesSpanPool<T>with aSharedstatic property (backed byArrayPool<T>.Shared) and aRent(int minimumLength = 1)method returningISpanOwner<T>;ISpanOwner<T>and the privateArrayPoolSpanOwner<T>impl move here from the old extensions fileArrayPoolExtensions.cs—extension(ArrayPool<T>)block withRentOwneris goneFileExtensions.cs— single call site updated accordinglyArrayPoolExtensionsTests.csreplaced bySpanPoolTests.csat the root test level