Skip to content

Commit

Permalink
Reuse memory block
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Jul 3, 2024
1 parent 9079cc1 commit 316b95c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,11 @@ protected override async ValueTask PersistAsync<TEntry>(TEntry entry, int index,
{
// fast path - write metadata and entry sequentially
metadata = LogEntryMetadata.Create(entry, startPos, length);
metadata.Format(metadataBuffer.Span);

await SetWritePositionAsync(writeAddress, token).ConfigureAwait(false);
await writer.WriteAsync(metadata, token).ConfigureAwait(false);
await writer.WriteAsync(metadataBuffer, token).ConfigureAwait(false);
await entry.WriteToAsync(writer, token).ConfigureAwait(false);

metadata.Format(metadataBuffer.Span);
}
else
{
Expand Down

0 comments on commit 316b95c

Please sign in to comment.