Skip to content

Conversation

walter-bai
Copy link
Contributor

Fix a ULT fail issue when driver dynamically links gmmlib.

Clear();
}

void Clear()
Copy link
Contributor

@dvrogozh dvrogozh Aug 16, 2018

Choose a reason for hiding this comment

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

Folks, I strongly suggest to remove constructor and Clear() entirely, You have class with all public members. C++11 already has a way to reset a structure to default value-initialization which is: m_drvSyms = {}.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for catching this, "m_drvSyms = {}" is much better than a Clear function.

{
auto p = (const void * const *)this;
for (auto i = 0; i < sizeof(this) / sizeof(const void *); i++)
for (auto i = 0; i < sizeof(*this) / sizeof(const void *); i++)
Copy link
Contributor

Choose a reason for hiding this comment

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

Folks, please, remove this and check pointers directly. This is simply a freak over complex implementation of very simple thing: check 5 pointers that they are not NULL. You don't need any loop here!!

Copy link
Contributor Author

@walter-bai walter-bai Aug 17, 2018

Choose a reason for hiding this comment

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

Yes, checking 5 pointers is simpler and easier to understand than previous code.

Copy link
Contributor

@dvrogozh dvrogozh left a comment

Choose a reason for hiding this comment

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

I have picked this change to #270 and fixed those 2 things I payed attention to in DriverSymbols class.

@yangning1368
Copy link
Contributor

It has been combined with PR#270. close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants