Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/coreclr/src/pal/src/map/virtual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace VirtualMemoryLogging
// An entry in the in-memory log
struct LogRecord
{
LONG RecordId;
ULONG RecordId;
DWORD Operation;
LPVOID CurrentThread;
LPVOID RequestedAddress;
Expand All @@ -118,14 +118,14 @@ namespace VirtualMemoryLogging
};

// Maximum number of records in the in-memory log
const LONG MaxRecords = 128;
const ULONG MaxRecords = 128;

// Buffer used to store the logged data
volatile LogRecord logRecords[MaxRecords];

// Current record number. Use (recordNumber % MaxRecords) to determine
// the current position in the circular buffer.
volatile LONG recordNumber = 0;
volatile ULONG recordNumber = 0;

// Record an entry in the in-memory log
void LogVaOperation(
Expand All @@ -137,7 +137,7 @@ namespace VirtualMemoryLogging
IN LPVOID returnedAddress,
IN BOOL result)
{
LONG i = InterlockedIncrement(&recordNumber) - 1;
ULONG i = (ULONG)InterlockedIncrement((LONG *)&recordNumber) - 1;
LogRecord* curRec = (LogRecord*)&logRecords[i % MaxRecords];

curRec->RecordId = i;
Expand Down