mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Reverted incorrect assumption about pointer casts/arithmetic
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user