Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix linux build issues
  • Loading branch information
AndyAyersMS committed Nov 11, 2021
commit 1f8800b5c938826c4fe283198f3882204a9fd052
3 changes: 1 addition & 2 deletions src/coreclr/inc/pgo_formatprocessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,13 @@ bool ReadInstrumentationSchemaWithLayout(const uint8_t *pByte, size_t cbDataMax,
//
inline bool ComparePgoSchemaCompatible(const uint8_t *pByte, size_t cbDataMax, ICorJitInfo::PgoInstrumentationSchema* schemaTable, size_t cSchemas)
Copy link
Member

@jakobbotsch jakobbotsch Nov 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a little surprised that this mutates the schema. Maybe rename it to something like SetOffsetsForSchemaSubsequence or similar?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about CheckIfPgoSchemaIsCompatibleAndSetOffsets?

{
size_t iSchema = 0;
size_t nSchema = 0;
size_t nMatched = 0;
size_t nUnmatched = 0;
size_t initialOffset = cbDataMax;

ReadInstrumentationSchemaWithLayout(pByte, cbDataMax, initialOffset,
[schemaTable, cSchemas, &iSchema, &nSchema, &nMatched, &nUnmatched](const ICorJitInfo::PgoInstrumentationSchema& schema)
[schemaTable, &nSchema, &nMatched, &nUnmatched](const ICorJitInfo::PgoInstrumentationSchema& schema)
{
const size_t iSchemaAdj = nSchema - nUnmatched;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same as nMatched?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And thinking a little bit more about it, that means this might index off the end of schemaTable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, yeah.


Expand Down