Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
badrishc committed Oct 10, 2021
1 parent 03af7ca commit 10744aa
Show file tree
Hide file tree
Showing 2 changed files with 371 additions and 368 deletions.
16 changes: 8 additions & 8 deletions cs/remote/src/FASTER.common/HeaderReaderWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ public unsafe bool Write(MessageType s, ref byte* dst, int length)
}

/// <summary>
/// Write serial number to memory
/// Write seqNum to memory
/// </summary>
/// <param name="seqNum">Message type</param>
/// <param name="dst">Destination memory</param>
/// <param name="length">Length of destination</param>
/// <returns>Whether write succeeded</returns>
/// <param name="seqNum"></param>
/// <param name="dst"></param>
/// <param name="length"></param>
/// <returns></returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe bool Write(long seqNum, ref byte* dst, int length)
{
if (length < sizeof(long)) return false;
*(long*) dst = seqNum;
*(long*)dst = seqNum;
dst += sizeof(long);
return true;
}
Expand All @@ -69,11 +69,11 @@ public unsafe MessageType ReadMessageType(ref byte* dst)
/// Read serial number
/// </summary>
/// <param name="dst">Source memory</param>
/// <returns>Message type</returns>
/// <returns>Serial number</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe long ReadSerialNum(ref byte* dst)
{
var result = *(long*) dst;
var result = *(long*)dst;
dst += sizeof(long);
return result;
}
Expand Down
Loading

0 comments on commit 10744aa

Please sign in to comment.