-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++ification] Take care of a few warnings and don't use LTO #3873
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,16 @@ namespace xamarin::android | |
{ | ||
struct timing_point | ||
{ | ||
time_t sec; | ||
uint64_t ns; | ||
time_t sec = 0; | ||
uint64_t ns = 0; | ||
|
||
void mark (); | ||
|
||
void reset () | ||
{ | ||
sec = 0; | ||
ns = 0; | ||
} | ||
}; | ||
|
||
struct timing_period | ||
|
@@ -37,6 +43,12 @@ namespace xamarin::android | |
{ | ||
end.mark (); | ||
} | ||
|
||
void reset () | ||
{ | ||
start.reset (); | ||
end.reset (); | ||
} | ||
}; | ||
|
||
struct timing_diff | ||
|
@@ -124,7 +136,7 @@ namespace xamarin::android | |
|
||
std::lock_guard<std::mutex> lock (sequence_lock); | ||
if (sequence->dynamic) { | ||
memset (sequence, 0, sizeof(*sequence)); | ||
sequence->period.reset (); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is odd...and I don't remember this coming up before... but why clear out In principal, the memset (sequence, 0, sizeof (*sequence);
memset (sequence, 0xbb, sizeof (*sequence); // or some other "`free` was here!" constant What's the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason clearing is done is that we don't control the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I wasn't advocating that our |
||
delete sequence; | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we're using
memcpy()
elsewhere, should we just usememcpy()
everywhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep using the string functions for string types elsewhere. The size calculations here appear to confuse the compiler which warns about code that is actually valid (on targets which have fortified string manipulation functions, e.g. in desktop builds), so using
memcpy
was the easiest way to shut the compiler up here.