Skip to content

Commit

Permalink
Set min buffer size when renting memory in FASTER key/value store (#364)
Browse files Browse the repository at this point in the history
Call to `MemoryBool<byte>.Shared.Rent()` now specifies a minimum buffer size that is large enough to hold the combined key and value.
  • Loading branch information
wazzamatazz authored Nov 21, 2023
1 parent a90ea4a commit 73e0714
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ private async ValueTask WriteCoreAsync(byte[] key, byte[] value) {
// the memory for the duration of the upsert, as required when using SpanByte:
// https://github.com/microsoft/FASTER/pull/349

using (var memoryOwner = MemoryPool<byte>.Shared.Rent()) {
using (var memoryOwner = MemoryPool<byte>.Shared.Rent(key.Length + value.Length)) {
if (memoryOwner == null) {
throw new InvalidOperationException(Resources.Error_UnableToRentSharedMemory);
}
Expand Down

0 comments on commit 73e0714

Please sign in to comment.