- Split file name setting code into two parts -- parsing code and the getter code
- better warning/error handling
- Removed the last dependence on malloc in profile runtime (the default path)
Details
- Reviewers
vsk
Diff Detail
Event Timeline
Nice, thanks.
lib/profile/InstrProfilingFile.c | ||
---|---|---|
88 | nit, This sounds like a name for a boolean. How about FilenameBuf? | |
112–117 | This is a behavior change, right? Do we really only want to truncate profiles if the filename pattern changes? | |
126 | Could you use strncpy? | |
129 | ^ Same comment | |
152 | nit, Use -> Using | |
161 | ^ Same nit |
lib/profile/InstrProfilingFile.c | ||
---|---|---|
112–118 | there is no change. If the pattern str changes, the filename will also change which requires truncation in previous implementation. |
lib/profile/InstrProfilingFile.c | ||
---|---|---|
112–118 | Got it, silly mistake on my part. |
lib/profile/InstrProfilingFile.c | ||
---|---|---|
129 | Note that strncpy is a really silly function: If you actually happen to write n or more characters you will not have a terminating '\0' character... My personal rule is to never use strncpy() but something like snprintf(buf, bufsize, "%s%s", one, two); |
nit, This sounds like a name for a boolean. How about FilenameBuf?