Skip to content

Commit dc4bc1d

Browse files
asolodovAlexander Solodov
and
Alexander Solodov
authored
[C#] Fix commit record pointer offset calculation (#912)
Co-authored-by: Alexander Solodov <[email protected]>
1 parent 281bdff commit dc4bc1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cs/src/core/FasterLog/FasterLogIterator.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public unsafe bool GetNext(MemoryPool<byte> pool, out IMemoryOwner<byte> entry,
379379
if (isCommitRecord)
380380
{
381381
FasterLogRecoveryInfo info = new();
382-
info.Initialize(new BinaryReader(new UnmanagedMemoryStream((byte *)physicalAddress, entryLength)));
382+
info.Initialize(new BinaryReader(new UnmanagedMemoryStream((byte*) (headerSize + physicalAddress), entryLength)));
383383
if (info.CommitNum != long.MaxValue) continue;
384384

385385
// Otherwise, no more entries
@@ -442,7 +442,7 @@ public unsafe bool TryConsumeNext<T>(T consumer) where T : ILogEntryConsumer
442442
if (isCommitRecord)
443443
{
444444
FasterLogRecoveryInfo info = new();
445-
info.Initialize(new BinaryReader(new UnmanagedMemoryStream((byte *)physicalAddress, entryLength)));
445+
info.Initialize(new BinaryReader(new UnmanagedMemoryStream((byte*) (headerSize + physicalAddress), entryLength)));
446446
if (info.CommitNum != long.MaxValue) continue;
447447

448448
// Otherwise, no more entries

0 commit comments

Comments
 (0)