Reverted incorrect assumption about pointer casts/arithmetic

This commit is contained in:
Yoshi Askharoun
2022-06-05 16:38:46 -05:00
parent 0c9345050b
commit c1fe12288c
3 changed files with 3 additions and 3 deletions
@@ -78,7 +78,7 @@ namespace Microsoft.Iris.Render.Protocol
public unsafe void Attach(Message* pMessage)
{
byte* numPtr1 = (byte*)pMessage + this.m_blobsOffset;
byte* numPtr1 = (byte*)((nint)pMessage + this.m_blobsOffset);
foreach (object obj in this.m_data)
{
if (obj is string)
@@ -181,7 +181,7 @@ namespace Microsoft.Iris.Render.Protocol
private unsafe void ZeroMemoryBlock(MessageHeap.BlockInfo block, uint offset, uint size)
{
Debug2.Validate(offset + size <= block.size, typeof(ArgumentOutOfRangeException), "Invalid memory range for block");
byte* start = (byte*)block.data + offset;
byte* start = (byte*)((nint)block.data + offset);
for (byte* current = start + size; start < current; ++start)
*start = 0;
}
@@ -470,7 +470,7 @@ namespace Microsoft.Iris.Render.Protocol
this._lastBatchEntry->uOffsetNextEntry = num;
else
((MessageBatchHeader*)block.data)->uOffsetFirstEntry = num;
this._lastBatchEntry = (MessageBatchEntry*)block.data + num;
this._lastBatchEntry = (MessageBatchEntry*)((nint)block.data + num);
this._lastBatchBlockId = block.id;
++this._uBatchedMessages;
BatchCallback populateCallback = this._batchPopulateCallback;