-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Backtracing][Linux] Replace regex with ProcMapsScanner. #66449
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
Conversation
@swift-ci Please smoke test |
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.
This is an excellent example of the power of regex.
} | ||
|
||
func isWhitespace(_ ch: UInt8) -> Bool { | ||
return ch == 32 || ch == 9 |
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.
Using UInt8(ascii:)
here would save people from looking up what ASCII 9 is, and be more consistent with the rest.
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'm probably showing my age there; I'll change to using UInt8(ascii:)
for all of them.
We were using a regular expression to scan `/proc/<pid>/maps`, but we shouldn't really do that because it breaks non-bootstrapped builds. rdar://110452324
466e733
to
d396656
Compare
@swift-ci Please smoke test |
+1 on that. There is a reason I wanted to use a regex here. I suspect the state machine is faster, but probably not by nearly enough to justify the extra time to write it. |
What? You mean someone doesn't know what ASCII 9 is? :-D I sometimes forget I grew up in a world of 8-bit micros and dot matrix printers, so ended up just knowing lots of ASCII control codes. |
We were using a regular expression to scan
/proc/<pid>/maps
, but we shouldn't really do that because it breaks non-bootstrapped builds.rdar://110452324
Resolves #66457