Skip to content

Conversation

@mgravell
Copy link
Contributor

@mgravell mgravell commented Sep 12, 2024

Context: dotnet/aspnetcore#57582 - MemoryCache may (opt-in) be enforcing size constraints; to satisfy that scenario, every L1 "set" operation must include an ICacheEntry.Size

(primary review here is probably from aspnetcore; all eyes are welcome, of course)

At first this sounds simple, but it means that we may need to serialize before we set the result, but we want to retain that buffer for the L2 write, which happens after we've supplied the value to the consumer. This requires a little bit of additional gymnastics; lots of comments included. Note also that BufferReleaseTests already has tests to ensure correct buffer release semantics.

Microsoft Reviewers: Open in CodeFlow

@mgravell mgravell marked this pull request as ready for review September 12, 2024 17:37
@mgravell mgravell merged commit c4f3aa8 into dotnet:dev Sep 18, 2024
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants